StatusBar Panel does not have a visible Property

Merchand

Well-known member
Joined
Dec 28, 2005
Messages
73
Location
USA Eastcoast
Programming Experience
10+
The old VB6 statusbar panel had a .visiable property. It looks like the new statusbar panel does not have this property. I need to hide two panels if there is no data for the two panels. Do I have to dynamically add and remove panels as needed? Or, is there a way to hide them if not used?

Any help is greatly appreciated! :)
 
In that case i would use width property ... just set up minimum width to 0 and then when you check for the text ... i.e.

VB.NET:
If Me.StatusBar1.panels(0).text = String.Empty then
[SIZE=2][COLOR=#0000ff] Me[/COLOR][/SIZE][SIZE=2].StatusBar1.Panels(0).Width = 0[/SIZE]
 
[SIZE=2]{...}[/SIZE]

Even it is not logical it will do the job

Regards ;)
 
Kulrom, thanks for the quick reply!

We are on the same page... Here is my code I just wrote...

If Value.Trim <> String.Empty Then
.MinWidth = 10
.Width = 104
.AutoSize = StatusBarPanelAutoSize.Contents
.Text = mAppSpecificData1
Else 'Setting the Width to zero should hide it...
.MinWidth = 0
.Width = 0
.AutoSize = StatusBarPanelAutoSize.None
.Text =
String.Empty

Have a great day!
 
to expand on Kulrom's post, if you actually name the statusbar panels, you can refer to the panels directly like you do for textboxes, button's, labels, etc...

sbp is the abbreviation i use, it's short for StatusBarPanel ie sbpTime would be a panel for displaying the time
 
Brotha, thanks for the tip! I did name my panels and I'll see if they show up in intelli-sense. sbp makes sense to me too... do you have a link to ms approved .net naming conventions for controls? I'm using camel and pascal naming for everything but controls and plan on keeping hungarian notation for controls but have not found an updated list.

Chow :)
 
Back
Top