Hi,
I have an administrator form that contain 4 tabs. Depending of what privileges the user have the user have access to some tab.
Here is the code that I use :
VB Code:
Dim strPrivileges As String = AvoirDroitUsager() Me.tabAdmin.Controls().Remove(Me.TabPage1) Me.tabAdmin.Controls().Remove(Me.TabPage2) Me.tabAdmin.Controls().Remove(Me.TabPage3) Me.tabAdmin.Controls().Remove(Me.TabPage4) If InStr(strPrivileges, "P") > 0 Then Me.tabAdmin.Controls().Add(Me.TabPage1) Me.tabAdmin.Controls().Add(Me.TabPage2) Me.tabAdmin.Controls().Add(Me.TabPage3) Me.tabAdmin.Controls().Add(Me.TabPage4) Else If InStr(strPrivileges, "A") > 0 Then Me.tabAdmin.Controls().Add(Me.TabPage4) End If If InStr(strPrivileges, "C") > 0 Then Me.tabAdmin.Controls().Add(Me.TabPage2) End If If InStr(strPrivileges, "M") > 0 Then Me.tabAdmin.Controls().Add(Me.TabPage3) End If End If
The problem is that I can't close the form since I have implemented that piece of code... why?




Reply With Quote