Posted 13 years ago by Kasper
Avatar
Hi,

I have created a new item in my BarManager, and allowed it to be checked. I'm using the Reflection trick to call various functions when my commands are clicked. Now, when this specific item is clicked, I would like to see if it's currently checked or not, and then do some thing. But how is that possible?

I'm using the latest (trial) version of UIStudio :)

[Modified at 03/31/2006 03:57 AM]

Comments (3)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Kasper,

You can always get the Checked state of a checkable command but you have to cast the command to its type. So for instance, the following code in our BarForm. It updates whether the MDI child close button is visible based on whether the View menu's associated checkable button command is checked or not.
private void ProcessViewMdiChildCloseButtonVisibility() {
    barManager.MdiChildCloseButtonVisible = 
        ((BarButtonCommand)barManager.Commands["View.MdiChildCloseButtonVisibility"]).Checked;
}


Actipro Software Support

Posted 13 years ago by Kasper
Avatar
Okay great, thank you. However, that does not give me access to the Visible property of the button. What should I cast to, to set the visibility of a menu item?
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
No cast is needed for that since Visible is common to all links. For instance this works fine in the BarForm sample:
barManager.DockableToolBars["Standard"].CommandLinks["File.New"].Visible = false;


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.