Enable/Disable items when Ribbon is Minimized |
Post Reply |
Author | |
H2Os
Newbie Joined: 08 February 2008 Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 08 February 2008 at 10:39am |
Hi
Have been using the CommandBar 11.2.0 with ribbon style for a week or so now - makes our app look really sweet!
But, I have found a reproducible problem...
Take the VB6 RibbonMDISample app, add a check box to frmDocument and add the following code in the _Click event:
Dim p_CommandControl As CommandBarControl
Set p_CommandControl = fMainForm.CommandBars.FindControl(, ID_EDIT_SELECT, , True) p_CommandControl.Enabled = (Check1.Value = vbChecked) Run the app and you will see that the Select button on the Edit tab enables and disables as expected.
Now click "Minimize the Ribbon" from the QAT, then click the Edit tab to make the ribbon popup. From now on, clicking the check box has no effect on the button at all, whether it is minimized or not.
There is a way round this, and that is to use Actions, but as I will only ever have one instance of an ID there seems little point in defining an action for each ID I want to be able to enable/disable.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
You need use Actions or Update handlers. FindControl is evil - using this way you will not update control in minimized ribbon or control that was added to QAT.
Actions is solution for you - it will update all instances with same Id:
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
H2Os
Newbie Joined: 08 February 2008 Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Thanks Oleg
Are you saying that FindControl shouldn't be used at all? What appens if one control affects another?
e.g. I have a combo box and some buttons which move the current selected item to first/previous/next /last - when the button is clicked how should I find the combo box?
Thanks
|
|
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 |