![]() |
How to disable an item in toolbar? |
Post Reply
|
| Author | |
lexicon
Groupie
Joined: 26 January 2007 Status: Offline Points: 46 |
Post Options
Thanks(0)
Quote Reply
Topic: How to disable an item in toolbar?Posted: 12 December 2007 at 8:28am |
|
How to disable an item in toolbar?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 12 December 2007 at 11:04am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 2:39am |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 7:36am |
|
It will usually be in the CommandBars_Update event.
|
|
![]() |
|
lexicon
Groupie
Joined: 26 January 2007 Status: Offline Points: 46 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 7:46am |
|
And how can i refer to the spesific item in Toolbar?
|
|
![]() |
|
jcollier
Senior Member
Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 1:01pm |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 1:40pm |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 1:48pm |
|
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 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2007 at 2:34pm |
|
Thanks a lot, that's what i want
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 December 2007 at 3:03pm |
|
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 |