![]() |
Disabling button |
Post Reply ![]() |
Author | |
Carter ![]() Newbie ![]() Joined: 13 March 2007 Location: United States Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 13 March 2007 at 8:28am |
Hi, I'm trying out this software and i seem to have most of it working. What i'm having problems with is being able to disable a button?? I checked the tutorials and it only shows how to use "disabled icons" for disabled buttons. could someone helpe me out?
Thanks
|
|
![]() |
|
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() |
Try declaring a global boolean variable then in the Update event set enabled propert of the button to the variable.
In General Declarations: dim blnBatchDetails as boolean Const ID_BATCHDETAILS = 1 in CommandBars_Update event: Select Case Control.ID Case ID_BATCHDETAILS Control.Enabled = blnBatchDetails End Select |
|
![]() |
|
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() |
Sorry, I should have followed up. When you want to disable or enable a button, all you have to do is change the value of the boolean variable and the update event will do the rest.
|
|
![]() |
|
Carter ![]() Newbie ![]() Joined: 13 March 2007 Location: United States Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
thanks for the reply. I am not sure what you mean. I created a Commandbar object called "CommandBars" (like the sample). I did see the UpdateEvent when i clicked the events button in the properties window and it showed up in the code behind file. I still don't know how to call the event though??
![]() |
|
![]() |
|
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() |
You don't have to call the event. It runs automatically every few milliseconds. Just put the Select Case in the Update Event. If you have a case for each of the buttons that you may want to enable/disable, the update event will update their enabled status to the value of the boolean variable every time it runs. It sounds like a lot of overhead but you shouldn't notice any performance problems.
|
|
![]() |
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 |