|
I have been trying to create a custom polyline class inheriting PolyLineConnector. In the documentation, I find three tools:
Me.Diagram1.Controller.ActivateTool("PolyLineLinkTool")
Me.Diagram1.Controller.ActivateTool("PolyLineTool")
Me.Diagram1.Controller.ActivateTool("PolyLineConnectorTool")
I assume that the PolyLineTool is just for drawing, not for linking
However, the other two do not seem working for me. Is there another definition of Polyline connector tool?
|
Please use polylineLinkTool to achieve your requirement. Also, please specify word line in lowercase for polylineLinkTool as shown in the below code example.
Code example:
diagram1.Controller.ActivateTool("PolylineLinkTool"); |
|
Furthermore, how can I define a custom polyline class that can be referenced in the PaletteGB? I tried to extend the orgline custom class to polyline custom class but I encounter errors on points of polyline vertices :
Dim pts() As PointF = {New PointF(100, 5), New PointF(200, 50), New PointF(10, 50), New PointF(150, 200)}
Dim polyline As New clsPolyconnector(pts)
The error points to (pts) saying 1 Dimentional table cant e converted to polyline, etc. In addition, I do not know which PolyLineTool to inherit in the custom polyline connector class
|
You can create customPolyline by inheriting PolyLineConnector to achieve your requirement. please refer to code example and sample below.
Code example:
SymbolPalette palette = new SymbolPalette();
palette.Name= "Connectors";
CustomPolyline polyline = new CustomPolyline(new PointF[]{ new PointF(100,100), new PointF(200,200), new PointF(300,300)});
palette.AppendChild(polyline);
this.paletteGroupBar2.AddPalette(palette);
|