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

Change button at runtime

 Post Reply Post Reply
Author
Message
amstel View Drop Down
Newbie
Newbie


Joined: 23 February 2004
Location: France
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote amstel Quote  Post ReplyReply Direct Link To This Post Topic: Change button at runtime
    Posted: 23 February 2004 at 6:55am

How to change at runtime the status of a button : Enabled=False

 

Sorry, I'm not speak english... French from Paris

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2004 at 7:27am

There are a few different ways. First, you need a handle to the button.

You can easily accomplish this in the CommandBars_Execute method. Just take a look at the samples.

You could also accomplish this in the CommandBars_ControlSelected method. This method would work well if you want to change the enabled property based on that control or another control being pressed.

If you want to change the property based on other conditions, unrelated to the commandBars, try using the CommandBars.FindControl method to get a pointer to your control. Once you have it, just change the enabled property.

Also, take a look at the CommandBars_Update method of the Office2003 sample.  This gives you the syntax for accomplishing the task.

Take a look at the CommandBars_InitCommandsPopUp method of the DynamicPopups sample for an example of using the .FindControl method.

Good luck

 

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.141 seconds.