Profile Picture

how can we add or remove the toolbar commands in nDiagramCommandBarManager toolbar

Posted By ginnas k 12 Years Ago
Author
Message
ginnas k
Posted 12 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 13, Visits: 1
hi

i have removed the command from the toolbar by using the following code

nDiagramCommandBarsManager1.Toolbars[4].Commands.RemoveAt(1);
so how can i add the removed command to the toolbar

in the documentation they telling about adding the custom commands but here these commands are predefined only so how can i do it

regards
ginnas



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi ginnas k,

The correct way to remove a diagram command from NDiagramCommandBarsManager is by using diagram commander:

NDiagramCommand cmd = nDiagramCommandBarsManager1.Commander.Commands.GetCommandFromId((int)DiagramCommand.About);
nDiagramCommandBarsManager1.Commander.Commands.Remove(cmd);
nDiagramCommandBarsManager1.Recreate();

To add the removed command you can either add the previously removed cashed command or create a new one:

If we have a reference to the removed command we just need to add it to the Commander.Commands collection:

nDiagramCommandBarsManager1.Commander.Commands.Add(cmd);

If we don't just create a new one and add it to Commands collection:

NAboutCommand cmd = new NAboutCommand();
nDiagramCommandBarsManager1.Commander.Commands.Add(cmd);

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic