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


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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


ginnas k
ginnas k
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
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


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search