//Registering the Node click event...
diagram1.EventSink.NodeClick += EventSink_NodeClick;
//Registering the Label text changed event...
diagram1.Controller.InPlaceEditor.LabelTextChanged += InPlaceEditor_LabelTextChanged;
private void InPlaceEditor_LabelTextChanged(object sender, EventArgs e)
{
///Write your logic here...
}
private void EventSink_NodeClick(NodeMouseEventArgs evtArgs)
{
///Write your logic here...
} |
diagram1.MouseUp += Diagram1_MouseUp;
private void Diagram1_MouseUp(object sender, MouseEventArgs e)
{
Syncfusion.Windows.Forms.Diagram.Node labelNode = null;
foreach (Node node in diagram1.Model.Nodes)
{
RectangleF bounds = node.GetNodeBounds(true, false);
if (bounds.Contains(diagram1.Controller.MouseLocation))
{
labelNode = node;
break;
}
}
Syncfusion.Windows.Forms.Diagram.Label label = findLabel(labelNode);
MessageBox.Show(label.Text);
} |