Update event & command bar |
Post Reply |
Author | |
dUGI
Newbie Joined: 11 August 2004 Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 10 September 2004 at 1:21pm |
How to use commandbars_update event to show or hide one or more commandbars? thans Miroslav |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
To hide the MenuBar:
CommandBars(1).Visible = False 'or CommandBars.ActiveMenuBar.Visible = False To hide the 1st toolbar: CommandBars(2).Visible = False |
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
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! |
|
dUGI
Newbie Joined: 11 August 2004 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
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? |
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
Have you tried using the 'Activate' and 'Deactivate' events of the MDI Child to show/hide the toolbar on the main form?
|
|
dUGI
Newbie Joined: 11 August 2004 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
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! |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |