Print Page | Close Window

Statusbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1096
Printed Date: 15 November 2024 at 5:05pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Statusbar
Posted By: Maui
Subject: Statusbar
Date Posted: 20 August 2004 at 3:44pm

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.

 




Replies:
Posted By: Boyd
Date Posted: 22 August 2004 at 9:16am

Maui,

I'd suggest moving to another StatusBar control that provides more functionality and just use the 'ControlSelected' event in CommandBars to set the description of the control in the status bar.  This event is fired when the user moves the mouse over a control.  One small hint when using this approach... the 'ControlSelected' event is fired with a null reference to a control when the user moves the mouse off the control, so this should be used to clear the description text.

The vbAccelerator site has some StatusBar controls you can look at if you don't already have one in mind:  http://www.vbaccelerator.com/home/VB/Code/Controls/Status_Bar/index.asp - http://www.vbaccelerator.com/home/VB/Code/Controls/Status_Ba r/index.asp



Posted By: Maui
Date Posted: 06 September 2004 at 8:17am

Have done as you suggested.

I spent about 6 hours trying to get the Codejock control to work properly without bugs. The vbaccelerator one I got going in 5 mins.

Thanks for you help.



Posted By: Boyd
Date Posted: 06 September 2004 at 8:26am
Glad I could help!


Posted By: SuperMario
Date Posted: 27 July 2005 at 9:16am
In the next release (9.71 available in 2-3 weeks), the statusbar will support icons\custom controls and setting the colors



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net