Profile Picture

How to customize command bars?

Posted By Eric Sweet 14 Years Ago
Author
Message
Eric Sweet
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 14, Visits: 1
Hi,

I'm trying to customize the toolbar by hiding some of the menu options and associated buttons, but can't figure out quite how to do it. I've tried the code sample in the KB to remove a command, and that works, but it leaves the menu item and button in place, just without functionality.

Any tips on how to accomplish this?

Thanks,
Eric

Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Eric,

You can set Visible property of the command properties to false. This way the command still will be in the toolbar Commands collection, but it will be invisible.

For example if you want to hide File -> New menu item and New command in the toolbars you can do the following:

NMenuBar mainMenu = (NMenuBar)nDiagramCommandBarsManager1.Toolbars["Main Menu"];

mainMenu.Commands[1].Commands[0].Properties.Visible = false;

NDockingToolbar toolbar = nDiagramCommandBarsManager1.Toolbars["Standard"];

NCommand c = toolbar.Commands[1];

c.Properties.Visible = false;

nDiagramCommandBarsManager1.Refresh();

I hope this helps.

Regards,

Angel Chorbadzhiev.



Eric Sweet
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 14, Visits: 1
That worked perfectly, thanks!

Eric



Similar Topics


Reading This Topic