The ShapeToolBar control displays image buttons representing selected shapes defined via the Shape class. These buttons can be used to create new shape nodes that have a specific shape or to change the shape of existing nodes.
Namespace: MindFusion.Diagramming.WinForms
Assembly: MindFusion.Diagramming.WinForms.Controls
C# Copy Code |
---|
public class ShapeToolBar : ToolBar |
Visual Basic Copy Code |
---|
Public Class ShapeToolBar |
In order to use the ShapeToolBar control, customize the Visual Studio toolbox and add a reference to MindFusion.Diagramming.WinForms.ShapeToolBar.dll.
Optionally, specify the list of shapes to display in the toolbar by assigning their string identifiers to the Shapes property. If Shapes is not set, or if it's an empty array, all available shapes are displayed in the toolbar. After changing Shapes or changing a Shape definition, you might have to call RecreateImages.
A shape can be dragged to the diagram canvas to create a new ShapeNode having that shape. To enable that, set the toolbar's AllowDrag and the DiagramView's AllowDrop properties to true.
Handle the ShapeClicked event to perform some action when the user clicks a shape button. For example, you could create a new ShapeNode, change the shape of selected nodes or change the Diagram's DefaultShape.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ToolBar
MindFusion.Diagramming.WinForms.ShapeToolBar