Print Page | Close Window

Disable Popup Menu in Control Button

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=18796
Printed Date: 23 November 2024 at 6:06am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Disable Popup Menu in Control Button
Posted By: idkami
Subject: Disable Popup Menu in Control Button
Date Posted: 07 August 2011 at 5:02am
I want to ask, how do I disable pop-up menu on the control button. For more details, like the following picture.

please help ---
thank's





Replies:
Posted By: Oleg
Date Posted: 08 August 2011 at 3:28am
Hi,

You need implement Update event. Check any our sample in CommanBars folder.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: idkami
Date Posted: 08 August 2011 at 10:31am
samples in the folder just using syntax like this:
    Set ControlSelect = GroupFind.Add(xtpControlPopup, ID_EDIT_SELECT, "&Select")
        ControlSelect.CommandBar.Controls.Add xtpControlButton, ID_EDIT_SELECT_ALL, "&Select All"
        Set Control = ControlSelect.CommandBar.Controls.Add(xtpControlButton, ID_EDIT_SELECT_OBJECTS, "&Select Objects")
        Control.Enabled = False
        Set Control = ControlSelect.CommandBar.Controls.Add(xtpControlButton, ID_EDIT_SELECT_MULTIPLE_OBJECTS, "Select Multiple Objects")
        Control.Enabled = False

and I want to disable by using the "FindControl".
I try to use syntax like this
:

RibbonBar.FindControl(, ID_EDIT_SELECT_OBJECTS).Enabled = False

turns an error like this:
"Object variable or with block variable not set"

what's the solution .. Please help.
I want to disable by using the function click on the CommandButton

please help



Posted By: Oleg
Date Posted: 09 August 2011 at 2:51am
Hi,

FindControl is worst way for that.  you need Update handler or Actions

call EnableActions before you create Ribbon and now you can Enable/Disable with

 CommandBars.Actions(ID_EDIT_SELECT_OBJECTS).Enabled = False




-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: idkami
Date Posted: 09 August 2011 at 5:46am
thanks for the help.
contained the same error when I use the event to another object, and errors like this: "Object variable or with block variable not set"

but I've found a way to use commandbars_update:
thanks in advance.

if you can, use the click on CommandButton?



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