Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - commandbar_update
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

commandbar_update

 Post Reply Post Reply
Author
Message
LittleJK View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 April 2006
Status: Offline
Points: 168
Post Options Post Options   Thanks (0) Thanks(0)   Quote LittleJK Quote  Post ReplyReply Direct Link To This Post Topic: commandbar_update
    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
Back to Top
apuhjee View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 September 2005
Location: United States
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote apuhjee Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2007 at 4:02am
Look into the UpdatePeriod property.
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
apuhjee View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 September 2005
Location: United States
Status: Offline
Points: 130
Post Options Post Options   Thanks (0) Thanks(0)   Quote apuhjee Quote  Post ReplyReply Direct Link To This Post Posted: 15 June 2007 at 1:48pm
Thanks for pointing that out gshawn.  It does help.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.