Security-Einstellungen setzen
[Visual Basic] Private Sub Set_Preferences( _
ByRef obj As Object, _
ByVal read_only As Boolean, _
ByVal invisible As Boolean, _
ByVal SecurityObjectItem As String _
)
[Visual Basic] Private Sub Set_Preferences(ByRef obj As Object, ByVal read_only As Boolean, ByVal invisible As Boolean, ByVal SecurityObjectItem As String)
Dim objtype As System.Type = obj.GetType
Select Case LCase(objtype.Name)
Case "toolstripmenuitem"
Dim ctl As ToolStripMenuItem = obj
If read_only Then ctl.Enabled = False
If invisible Then
ctl.Visible = False
ctl.Enabled = False
End If
Case "textbox", "label", "combobox", "checkbox", "toolstripbutton", "panel"
If read_only Then obj.Enabled = False
If invisible Then obj.Visible = False
Case "tabpage"
If invisible Then
Dim tbp As TabPage = obj
For Each x As MyFormControls In Me.ctlcol
If x.MySecurityObject = tbp.Parent.Name Then
Dim tb As TabControl = x.MyControl
tb.TabPages.Remove(tbp)
Exit Sub
End If
Next
End If
If read_only Then obj.enabled = False
Case "c1truedbgrid"
Dim ctl As C1TrueDBGrid = obj
If SecurityObjectItem = "" Then
If read_only Then ctl.Enabled = False
If invisible Then obj.Visible = False
Else
If read_only Then ctl.Splits(0).DisplayColumns(SecurityObjectItem).Locked = True
If invisible Then ctl.Splits(0).DisplayColumns(SecurityObjectItem).Visible = False
End If
End Select
End Sub
Plattformen: Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition