There is a bug with how the statusbar works with the CommandBars DescriptionText.
The documentation says "The custom status bar uses the DescriptionText property of your Command Bar controls to display text in the "Idle Text" pane when the mouse is positioned over a Command Bar control simply by adding a pane with Id zero."
The bug is that the DescriptionText is actually displayed in the pane with Index 0 (as opposed to ID 0)
Here is how I created my statusbar
Const ID_STATUS_PANE = 0 Const ID_CUSTOM_PANE = 300
Dim StatusBar As IStatusBar Set StatusBar = formMain.CommandBars.StatusBar StatusBar.IdleText = "" StatusBar.AddPane ID_CUSTOM_PANE StatusBar.SetPaneStyle ID_CUSTOM_PANE, SBPS_STRETCH StatusBar.AddPane ID_STATUS_PANE StatusBar.SetPaneWidth ID_STATUS_PANE, 100
StatusBar.Visible = True
When I move my mouse over a menu item the description text is always displayed in the ID_CUSTOM_PANE pane. ie the pane that was created first.
I came across this because I couldnt see how big the pane was since the first pane is created with no borders so I started shuffeling the panes around to see what would happen.
On further investigation it seems that a pane created with ID = 0 is created with pre assigned styles which isnt mentioned in the documentation. 1. It is created with no borders style. 2. It seems to be created with the stretch style applied so you cant set its width (since stretch style overrides any size value)
I found that to get the layout I required I had to enter StatusBar.SetPaneStyle 0, 0 then I could size my panes properly.
Can you add TextAlignment as a property please.
Can you add icons as a property please.
Can you add a MinimumWidth property please which could be used in conjunction with the stretch style.
Can you add a PaneAlignment please to make it possible for one small pane on the left and one small pane on the right.
|