how can remove panel in statusbar?

J

jonathan

Hi All !

I am Making MDI Application.
when I clicked MenuItem,New ChildForm Shows and StatusBar add panel
panel's Text Property has ChildForm.Text

Following Snippets


Dim panel As New StatusBarPanel

panel.AutoSize = StatusBarPanelAutoSize.Contents

' Set the text alignment within each panel.
panel.Alignment = HorizontalAlignment.Left

' Display the first panel without a border and the second
' with a raised border.
panel.BorderStyle = StatusBarPanelBorderStyle.Raised
'lbpgName has FormName
panel.Text = lbpgName.Text

' Display panels in statusBar1 and add them to the
' status bar's StatusBarPanelCollection.
stMain.ShowPanels = True
stMain.Panels.Add(panel)

when I Closed ChildForm1,I remove Panel of ChildForm1 in StatusBar

How Can Remove panel in StatusBar?

P.S
I'am sorry for my Poor English..
 
W

webmasta

I am not sure you can remove/hide the panels programatically, but you can give the panel the same
borderstyle as the one next to it so it gives the impression that it disappeared.

~webmasta


| Hi All !
|
| I am Making MDI Application.
| when I clicked MenuItem,New ChildForm Shows and StatusBar add panel
| panel's Text Property has ChildForm.Text
|
| Following Snippets
|
|
| Dim panel As New StatusBarPanel
|
| panel.AutoSize = StatusBarPanelAutoSize.Contents
|
| ' Set the text alignment within each panel.
| panel.Alignment = HorizontalAlignment.Left
|
| ' Display the first panel without a border and the second
| ' with a raised border.
| panel.BorderStyle = StatusBarPanelBorderStyle.Raised
| 'lbpgName has FormName
| panel.Text = lbpgName.Text
|
| ' Display panels in statusBar1 and add them to the
| ' status bar's StatusBarPanelCollection.
| stMain.ShowPanels = True
| stMain.Panels.Add(panel)
|
| when I Closed ChildForm1,I remove Panel of ChildForm1 in StatusBar
|
| How Can Remove panel in StatusBar?
|
| P.S
| I'am sorry for my Poor English..
|
 
R

rs

Me.stbStatus.Panels.Remove(panelName)
Me.stbStatus.Panels.RemoveAt(PanelIndex)

If you want to Hide a panel without removing it use the following
workaround:

Me.StatusBarPanel4.AutoSize = StatusBarPanelAutoSize.None
Me.StatusBarPanel4.Text = Nothing
Me.StatusBarPanel4.Width = 0

Where StatusBarPanel4 is the name of the panel to be hidden.

I hope that helped
Ahmed
 
Top