Print Page | Close Window

commandbar_update

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=7254
Printed Date: 18 June 2025 at 1:28pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: commandbar_update
Posted By: LittleJK
Subject: commandbar_update
Date Posted: 29 May 2007 at 11:25am
Is there anyway around using commandbar_update? We are finding that the update event gets fired all the time when the form is opened. we are wondering if there is a way to by pass commandbar_update or to slow it down/less calls.

Thanks



Replies:
Posted By: apuhjee
Date Posted: 14 June 2007 at 1:47pm
I would really appreciate an answer to this question.
 
Maybe I'm missing something here, but it seems like this polling model is a step backwards from the modern event model.
 
What are the benefits?
 
Thanks ~ jp


-------------
I like mathematics because it is not human and has nothing particular
to do with this planet or with the whole accidental universe — because,
like Spinoza's God, it won't love us in return.


Posted By: gshawn
Date Posted: 15 June 2007 at 4:02am
Look into the UpdatePeriod property.


Posted By: gshawn
Date Posted: 15 June 2007 at 4:31am
The benefit is that you can have all of your commandbar status maintenance code in a single method (rather than needing to add code to every single event that an object could fire when its state is modified).
 
For example, there is no SelChange event for the textbox control. If you have a "Bold Text" button that you only want to enable when some text is selected, you would need to add code to handle at least the keyboard and mouse events.
 
With what you call the "polling model" however, you only need to add a single line of code to the CommandBar_Update event:
 
Item.Enabled = (txtBox.SelLength > 0)
 
Hope this helps!


Posted By: apuhjee
Date Posted: 15 June 2007 at 1:48pm
Thanks for pointing that out gshawn.  It does help.



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