Print Page | Close Window

Update event & command bar

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=1165
Printed Date: 10 May 2024 at 5:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Update event & command bar
Posted By: dUGI
Subject: Update event & command bar
Date Posted: 10 September 2004 at 1:21pm

How to use commandbars_update event to show or hide one or more commandbars?

thans

Miroslav




Replies:
Posted By: SuperMario
Date Posted: 10 September 2004 at 1:24pm
To hide the MenuBar:
    CommandBars(1).Visible = False
'or
    CommandBars.ActiveMenuBar.Visible = False

To hide the 1st toolbar:
    CommandBars(2).Visible = False


Posted By: Boyd
Date Posted: 11 September 2004 at 9:10am

Depending on your intent, the 'Update' event probably isn't the best place to do that.  This event is fired several times a second for each visible control on a toolbar, and once for each control in a menu.

You certainly can use the 'Update' event for this, but it's really designed for you to update an individual control.  Since this code is called so often, you should minimize the processing that is done in the routine.

Just some extra thoughts on the subject... good luck!



Posted By: dUGI
Date Posted: 11 September 2004 at 9:39am

Thanks, but that will not solve my problem. It is really designed for individual control, so it won't fire update event for command bar. I tried do put some code, to show or hide command bar depending on type of form displayed (MDI child) but then I got problem with dock control which ih rather important.

I know about visible property :) but, still doesn't solve my problem. I have two toolbars in my program. One is visible all the time (toolbar Standard) and the other one is visible only if certain type of form is displayed. So, what event or piece of code should I use?



Posted By: Boyd
Date Posted: 11 September 2004 at 10:11am
Have you tried using the 'Activate' and 'Deactivate' events of the MDI Child to show/hide the toolbar on the main form?


Posted By: dUGI
Date Posted: 11 September 2004 at 10:22am

Thanks.

Yes, I tried! But that was one of the reasons why I switched from DataDynamics to CodeJock. I don't want to use Activate and esp. Deactivate in that manner.

Maybe I would manage to show/hide bar, but if there is no dock on the form. I can use this line:

cBars.Item(2).Visible = Not ActiveForm Is Nothing

but, then, I can't expand dock (at any side of the form). It starts to expand, expand a 0.5 cm, collapse, and repeating that!?! Rather strange behaviour!




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