Profile Picture

disable toolbars from NDiagramCommandBarsManager

Posted By Hans Henrik Friis Pedersen... 7 Years Ago
Author
Message
Hans Henrik Friis Pedersen...
Question Posted 7 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 6 Years Ago
Posts: 28, Visits: 136
Hi,

I would like to disable a number of toolbars in Designmode. If I right click on the NDiagramCommandBarsManager and choose "Show Editor" I can disable the different Toolbars. However, when I'm in Runtime, the disabled toolbars seem to re-appear.

How do I make the different toolbars disappear or ".visual = false;"
How can I in runtime make the different toolbars disappear - I have tried to use

nDiagramCommandBarsManager1.Toolbars.


but I do not know how to locate for instance the "Tools" toolbars and inactive that toolbar...



Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)Supreme Being (4,274 reputation)

Group: Forum Members
Last Active: 3 Weeks Ago
Posts: 3,027, Visits: 3,672
Hi,

The NDiagramCommandBarsManager rebuilds the toolbars it contains in its constructor. That is why when you run the program the command bars will be reset. You can either hide the toolbars after the manager is created, or override the command bars builder.

Take a look at the following example:
Visual Interface Components - Command Bars


Best Regards,
Nevron Support Team



Hans Henrik Friis Pedersen...
Posted 7 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 6 Years Ago
Posts: 28, Visits: 136
Hi,

I'm afraid the example you stated is of very little help. However, I worked it out my self.

Use the following code; Make sure that the mentioned code is AFTER initilizeComponent:


InitializeComponent();   
//MessageBox.Show(nDiagramCommandBarsManager1.Toolbars[0].ToString() );   
nDiagramCommandBarsManager1.Toolbars[0].Visible = false;   
nDiagramCommandBarsManager1.Toolbars[3].Visible = false;   
nDiagramCommandBarsManager1.Toolbars[4].Visible = false;   
nDiagramCommandBarsManager1.Toolbars[5].Visible = false;   
nDiagramCommandBarsManager1.Toolbars[6].Visible = false;   
nDiagramCommandBarsManager1.Toolbars[7].Visible = false;





Similar Topics


Reading This Topic