)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resize particular node alone in the selection list

Platform: WinForms |
Control: Diagram |
Published Date: November 26, 2015 |
Last Revised Date: June 2, 2019

Resize particular node alone in the selection list

Diagram allows you to resize a particular children in the selection list. It can be achieved through Diagram Model’s EventSink.SizeChanging event. This event is triggered while changing the size of the node.

The below code snippet is used for resizing a particular node in the selection list.

[C#]

//Registering the SizeChanging event
Diagram.Model.EventSink.SizeChanging += EventSink_SizeChanging;
 
Private Sub EventSink_SizeChanging(ByVal evtArgs As SizeChangingEventArgs);
if (Diagram.View.SelectionList.Count > 1 && evtArgs.NodeAffected is Node && !(evtArgs.NodeAffected is PseudoGroup))
{
if (Diagram.View.SelectionList.IndexOf(evtArgs.NodeAffected as Node) == 0)
{
Node node = evtArgs.NodeAffected as Node;
evtArgs.Cancel = false;
NodeCollection collection = new NodeCollection();
for (var i = 0; i < Diagram.View.SelectionList.Count; i++)
{
Microsoft.VisualBasic.Collection.Add(Diagram.View.SelectionList(i));
}
Diagram.View.SelectionList.Clear();
for (var i = 0; i < Microsoft.VisualBasic.Collection.Count; i++)
{
Diagram.View.SelectionList.Add(collection(i));
}
}
else
{
evtArgs.Cancel = true;
}
}
}

 

[VB]

'Registering the SizeChanging event
Diagram.Model.EventSink.SizeChanging += EventSink_SizeChanging
 
Private Sub EventSink_SizeChanging(ByVal evtArgs As SizeChangingEventArgs)
If Diagram.View.SelectionList.Count > 1 AndAlso TypeOf evtArgs.NodeAffected Is Node AndAlso Not(TypeOf evtArgs.NodeAffected Is PseudoGroup) Then
If Diagram.View.SelectionList.IndexOf(TryCast(evtArgs.NodeAffected, Node)) = 0 Then
Dim node As Node = TryCast(evtArgs.NodeAffected, Node)
evtArgs.Cancel = False
Dim collection As New NodeCollection()
For i = 0 To Diagram.View.SelectionList.Count - 1
Microsoft.VisualBasic.Collection.Add(Diagram.View.SelectionList(i))
Next i
Diagram.View.SelectionList.Clear()
For i = 0 To Microsoft.VisualBasic.Collection.Count - 1
Diagram.View.SelectionList.Add(collection(i))
Next i
Else
evtArgs.Cancel = True
End If
End If
}

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon