Cari Blog Ini

08 September 2011

Code for Create Status Bar in ASP.NET

1. Add Toolbox > Windows Forms > Status Bar

2.

'------------------------------------------------------------------------------------------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        _CreatePanelStatusBar()
    End Sub



    Public Sub _CreatePanelStatusBar()
        'Membuat panel dan mengatur properti teks.
        StatusBar1.Panels.Add("Ready..")
        StatusBar1.Panels.Add("")
        StatusBar1.Panels.Add("")

        'Mengatur properti panel StatusBar.
        'Mengatur properti panel AutoSize.
        StatusBar1.Panels(0).AutoSize = _
        StatusBarPanelAutoSize.Spring
        StatusBar1.Panels(1).Width = 200
        StatusBar1.Panels(2).Width = 200

        ' Mengatur properti panel BorderStyle.
        StatusBar1.Panels(0).BorderStyle = _
        StatusBarPanelBorderStyle.Raised
        StatusBar1.Panels(1).BorderStyle = _
        StatusBarPanelBorderStyle.Sunken
        StatusBar1.Panels(2).BorderStyle = _
        StatusBarPanelBorderStyle.Sunken

        ' Mengatur perataan panel
        StatusBar1.Panels(0).Alignment = _
        HorizontalAlignment.Left
        StatusBar1.Panels(1).Alignment = _
        HorizontalAlignment.Center
        StatusBar1.Panels(2).Alignment = _
        HorizontalAlignment.Center

        'Menambahkan properti teks pada panel ketiga dengan
        'tanggal(sekarang)
        StatusBar1.Panels(1).Text = "Welcome....."
        StatusBar1.Panels(2).Text = _
        System.DateTime.Today.ToLongDateString()

        'Mengatur properti icon pada panel ketiga
        StatusBar1.ShowPanels = True
    End Sub
'------------------------------------------------------------------------------------------------


Sumber:
www.ilmukomputer.com