Print Page | Close Window

Chaning the state of a CommandBar Control

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=1617
Printed Date: 24 June 2024 at 9:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Chaning the state of a CommandBar Control
Posted By: amorton
Subject: Chaning the state of a CommandBar Control
Date Posted: 03 January 2005 at 1:21pm
Hello have been trying to write some code to disable a menu option in the command bar. I followed the documentation and used the "DesignerControls" controls collection off the command bars control to find a control and change its enabled property. This did nothing.

Eventually i found the "Update" event, in the online help it says "Occurs when a command bar control has been updated." (and not much else)  which more than implies it is fired *after" a control has been updated. However one of the tutorials implies that if i want to disable a menu option the only place i can do it is in the "Update" event.

So my questions are....
1) Is there are way to select a control from the command bars and disable it outside of the Update event ?

2) Is the only way to change the state of a command bar control  in the Update event ?

3) What is the trigger for the Update event to fire for a particular control ? The online help says of the "control" param "The command bar control which has been updated." so what do i need to do to inorder for a control to be considered Updated ?

thanks for any help.
aaron




Replies:
Posted By: SuperMario
Date Posted: 03 January 2005 at 5:11pm
1. Yes, Update event is only one way to do it.  You can simply use one of the Find method to find the control and change its properties.  Change them in the Controls collection, not the DesignerControls.  Do a search on forum for DesignerControls, I have explained them a few times

2. No

3. It is fired every 100 milliseconds by default.  You can change this by setting the UpdatePeriod property.


Posted By: amorton
Date Posted: 04 January 2005 at 9:48am
Thanks for that. I looked at the other posts and discovered what i was missing. I did not realise i needed to call FindControl with the recursive param set. As i was calling it on the control itself and not on a command bar i did not think it was necessary.

Is there a way to disable the update event ? I tried setting the UpdatePeriod property on the commandBarsOptions object to zero but that just made it run as fast as it could.

I realise i could  just not implement an event handler but if i do that will the control still be fireing the event ?

thanks


Posted By: SuperMario
Date Posted: 04 January 2005 at 9:51am
You cant disable it, but you could set the UpdatePeriod to something like every 10 minutes.  Or you could have some variable that controls if the conde in the Update event is executed.



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