![]() |
How to disable an item in toolbar? |
Post Reply ![]() |
Author | |
lexicon ![]() Groupie ![]() Joined: 26 January 2007 Status: Offline Points: 46 |
![]() ![]() ![]() ![]() ![]() Posted: 12 December 2007 at 8:28am |
How to disable an item in toolbar?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Please start learning from our samples. They have a lot of such things.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
lexicon ![]() Groupie ![]() Joined: 26 January 2007 Status: Offline Points: 46 |
![]() ![]() ![]() ![]() ![]() |
Sorry but even if i'm seeing you doing it in your samples, i still don't understand how you are doing it
|
|
![]() |
|
ijwelch ![]() Senior Member ![]() Joined: 20 June 2006 Status: Offline Points: 262 |
![]() ![]() ![]() ![]() ![]() |
It will usually be in the CommandBars_Update event.
|
|
![]() |
|
lexicon ![]() Groupie ![]() Joined: 26 January 2007 Status: Offline Points: 46 |
![]() ![]() ![]() ![]() ![]() |
And how can i refer to the spesific item in Toolbar?
|
|
![]() |
|
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() |
Set up a boolean variable for each button that you want to enable/disable.
In your CommandBars_Update event, set the enabled property for each button to the value of the corresponding variable, like so (or you could specify each button exactly instead of using Select Case): Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl) Select Case Control.ID Case ID_FIRSTPAGEOFDOCUMENT Control.Checked = blnFirstPageOfDocument Case ID_SUPERVISORCHECK Control.Checked = blnSupervisorCheck Control.Enabled = blnSupervisorCheckEnable Case ID_PAGEDOWNNEXTDOCUMENT Control.Checked = blnPageDownToNextDocument Case ID_SPELLCHECKTOGGLE Control.Checked = blnSpellCheck Case ID_HOMEANDENDKEYENDOFLINETOGGLE Control.Checked = blnHomeAndEndKey Case ID_ENTERKEYPAGEDOWN Control.Checked = blnEnterKeyPageDown Case ID_SUPERVISORCHECKNOTES Control.Enabled = blnSupervisorCheckComments End Select End Sub When you want to change the enabled state of a button, you simply set the value of the corresponding boolean variable to the desired value. The update event will then take over and enable/disable the button for you. |
|
![]() |
|
lexicon ![]() Groupie ![]() Joined: 26 January 2007 Status: Offline Points: 46 |
![]() ![]() ![]() ![]() ![]() |
The Update event happens all the time
I want the program to start with a button disabled (which i can do with Update event) and then after a button clicked to disable another one
Lets say you have a New button and a Save Button
The Save button will be disabled and when the New button clicked, the New button will be disabled and the Save button will be enabled
Thank you very much for your help
|
|
![]() |
|
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() |
Right. What I would do there is set up boolean variables in the General Declaration of the form for each of your 2 buttons.
In Form_Load set the booleans to the disable/enable values you want. In CommandBars_Update set the enabled property of each button to the boolean value In the click event of each button, set the boolean values to the desired state. That should do it. |
|
![]() |
|
lexicon ![]() Groupie ![]() Joined: 26 January 2007 Status: Offline Points: 46 |
![]() ![]() ![]() ![]() ![]() |
Thanks a lot, that's what i want
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Jason, Thanks for help. :-)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |