Print Page | Close Window

Change button at runtime

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=466
Printed Date: 27 April 2024 at 12:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change button at runtime
Posted By: amstel
Subject: Change button at runtime
Date 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




Replies:
Posted By: robs
Date 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

 




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