How to force "Update" of CommandBar Ctrl |
Post Reply |
Author | |
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
Posted: 08 June 2004 at 10:01am |
I use the 'Update' event of CommandBars to determine when controls should be enabled and set various other properties. I also use the 'Execute' event for most of my actions. I came across the need to "trigger" the Execute event for a control that was not necessarily clicked upon. For instance, I have certain internal shortcut keys that will trigger a command without using KeyBindings (this was done by design since KeyBindings intercepts all shortcut keys). I created the following routine to trigger the execution of a command based on the ID of the command bar control: Public Sub ExecuteCommandBarControl(ByRef CommandBars As CommandBars, ByVal ID As Long) This results in the Execute event being fired. The problem is that this temporary control never gets passed to the 'Update' event because it is never shown. Is there a way to force the command to update? If not, would it be possible to add an 'Update' method to the CommandBarControl that would trigger the 'Update' event? Then would allow me to modify the procedure to only execute the control if the control is enabled (as is set in the Update event). In other words, this is what I would like to be able to do: Public Sub ExecuteCommandBarControl(ByRef CommandBars As CommandBars, ByVal ID As Long) Thanks in advance. |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
For any new users that might read this post, an Execute method was added that will allow you to execute individual controls.
|
|
Boyd
Senior Member Joined: 08 December 2003 Location: United States Status: Offline Points: 285 |
Post Options
Thanks(0)
|
SuperMario, If you look at the original post, it actually uses the Execute method. The code snippet was provided so that you could trigger the execution of a control based purely on the ID of the control without having to search for that control in a command bar. Look closely and it will make more sense. As you may have noticed, nobody ever responded to my request for an Update method to accompany the Execute method. Any chance of getting something like this added? Thanks! |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
I will definetly pass this on to development. I understand now.
|
|
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 |