Sub BuatPanelStatusBar()
StatusBar1.Panels.Add("Ready..")
StatusBar1.Panels.Add("")
StatusBar1.Panels.Add("")
StatusBar1.Panels(0).AutoSize = _
StatusBarPanelAutoSize.Spring
StatusBar1.Panels(1).Width = 300
StatusBar1.Panels(2).Width = 300
StatusBar1.Panels(0).BorderStyle = _
StatusBarPanelBorderStyle.Raised
StatusBar1.Panels(1).BorderStyle = _
StatusBarPanelBorderStyle.Sunken
StatusBar1.Panels(2).BorderStyle = _
StatusBarPanelBorderStyle.Sunken
StatusBar1.Panels(0).Alignment = _
HorizontalAlignment.Left
StatusBar1.Panels(1).Alignment = _
HorizontalAlignment.Center
StatusBar1.Panels(2).Alignment = _
HorizontalAlignment.Center
StatusBar1.Panels(1).Text = "Selamat Datang" & " - " & Nama
StatusBar1.Panels(2).Text = _
System.DateTime.Today.ToLongDateString()
StatusBar1.ShowPanels = True
End Sub
Sub CekOtoritas()
If RoleID = 1 Then
SubPenjualan.Enabled = True
SubPembelian.Enabled = False
ElseIf RoleID = 2 Then
SubPenjualan.Enabled = False
SubPembelian.Enabled = True
ElseIf RoleID = 3 Then
SubPenjualan.Enabled = False
SubPembelian.Enabled = False
ElseIf RoleID = 4 Then
SubPenjualan.Enabled = True
SubPembelian.Enabled = True
End If
End Sub
disarankan untuk membuat kode di dalam #region kemudian kode dipanggil dengan perintah "Call".
StatusBar1.Panels.Add("Ready..")
StatusBar1.Panels.Add("")
StatusBar1.Panels.Add("")
StatusBar1.Panels(0).AutoSize = _
StatusBarPanelAutoSize.Spring
StatusBar1.Panels(1).Width = 300
StatusBar1.Panels(2).Width = 300
StatusBar1.Panels(0).BorderStyle = _
StatusBarPanelBorderStyle.Raised
StatusBar1.Panels(1).BorderStyle = _
StatusBarPanelBorderStyle.Sunken
StatusBar1.Panels(2).BorderStyle = _
StatusBarPanelBorderStyle.Sunken
StatusBar1.Panels(0).Alignment = _
HorizontalAlignment.Left
StatusBar1.Panels(1).Alignment = _
HorizontalAlignment.Center
StatusBar1.Panels(2).Alignment = _
HorizontalAlignment.Center
StatusBar1.Panels(1).Text = "Selamat Datang" & " - " & Nama
StatusBar1.Panels(2).Text = _
System.DateTime.Today.ToLongDateString()
StatusBar1.ShowPanels = True
End Sub
Sub CekOtoritas()
If RoleID = 1 Then
SubPenjualan.Enabled = True
SubPembelian.Enabled = False
ElseIf RoleID = 2 Then
SubPenjualan.Enabled = False
SubPembelian.Enabled = True
ElseIf RoleID = 3 Then
SubPenjualan.Enabled = False
SubPembelian.Enabled = False
ElseIf RoleID = 4 Then
SubPenjualan.Enabled = True
SubPembelian.Enabled = True
End If
End Sub
disarankan untuk membuat kode di dalam #region kemudian kode dipanggil dengan perintah "Call".