The problem is that I cannot see anything |
On further analyzing your sample, we found that you have set minimum value for the Diagram.Model’s LogicalSize and created a node outside of the diagram’s drawing area. So only, the node doesn’t add into the diagram page.
We suggest you to disable the Diagram.Model’s BoundaryConstraintsEnabled property while drawing/creating the node outside of the drawing area.
Code example:
this.diagram1.Model.BoundaryConstraintsEnabled = false; |
WHile create a node I want to setup a start point but I have access only to PinPoint (which is Not the same) |
The PinPoint property represents the middle position of the node which is calculated by dividing the node’s size by half. So please use below code example to achieve your requirement.
Code example:
[C#]
barNode.PinPoint = newPointF(rectBounding.Location.X + rectBounding.Width / 2, rectBounding.Location.Y + rectBounding.Height / 2); |
I would like in the right click (contextmenu) to keep only the "Align" , "Flip" , "Order" and "Rotate" . But as you can see in the sample I habe to click 3-4 times before achieve the desired result |
We have modified your code example to achieve your requirement
Code example:
[C#]
int i = diagram1.ContextMenuStrip.Items.Count - 1;
while(diagram1.ContextMenuStrip.Items.Count - 1 != 3)
{
if(diagram1.ContextMenuStrip.Items[i] isToolStripSeparator)
{
ToolStripSeparator item = diagram1.ContextMenuStrip.Items[i] asToolStripSeparator;
diagram1.ContextMenuStrip.Items.Remove(item);
}
else
{
ToolStripMenuItem item = diagram1.ContextMenuStrip.Items[i] asToolStripMenuItem;
if (item.Text !="Align" && item.Text != "Flip" && item.Text !="Order" && item.Text != "Rotate")
{
diagram1.ContextMenuStrip.Items.Remove(item);
}
}
i--;
} |