Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the size of the status bar panels 2

Status
Not open for further replies.

anet

Programmer
Jul 10, 2001
35
CA
I want to make sure the panels on the status bar are wide enough to display the message I am passing in. I tried:
sbMain.Panels.Width = len(message) and got a compile error that the width property could not be set. Then I tried
sbMain.Panels(1).MinWidth = len(message). This time it said that the index was out of bounds, but I only have one panel and when I went to the custom properties box it says it is index #1.

What am I missing?

Thanks.
 
Hi,

You can try this:

StatusBar1.Panels.Item(1).Style = sbrText
StatusBar1.Panels.Item(1).AutoSize = sbrContents

Have a good one!
BK
 
You can set MinWidth by rightclicking the control and going to properties. Select Panels Tab then set your required MinWidth. Then set Autosize to whichever of the 3 choices you need.

Otherwise you can set it programmatically thus:

Code:
StatusBar1.Panels(1).AutoSize = sbrContents

or whichever constant you need Let me know if this helps

Check out FAQ222-2244
'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top