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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to determine when a docking window is transitioned to an MDIChild form others?

 

Usually MDIClient’s ControlAdded/ControlRemoved events are fired whenever an MDIChild form is added or removed. So subscribing into these events are used to determine the state transitions. Please refer the below code snippet which illustrates this:

C#

foreach (Control ctrl in this.Controls)

{

if (ctrl.GetType() == typeof(MdiClient))

{

ctrl.ControlAdded += new ControlEventHandler(this.MDIClient_ControlAdded);

ctrl.ControlRemoved += new ControlEventHandler(this.MDIClient_ControlRemoved);

break;

}

}

protected void MDIClient_ControlAdded(object sender, ControlEventArgs e)

{

if (e.Control is Syncfusion.Windows.Forms.Tools.DockingWrapperForm)

{

Console.WriteLine("Docking window to MDIChild transition");

}

}

protected void MDIClient_ControlRemoved(object sender, ControlEventArgs e)

{

if (e.Control is Syncfusion.Windows.Forms.Tools.DockingWrapperForm)

{

Console.WriteLine("MDIChild to Docking window transition");

}

}

VB

For Each ctrl As Control In Me.Controls

If ctrl.GetType() Is GetType(MdiClient) Then

AddHandler ctrl.ControlAdded, AddressOf MDIClient_ControlAdded

AddHandler ctrl.ControlRemoved, AddressOf MDIClient_ControlRemoved

Exit For

End If

Next ctrl

Protected Sub MDIClient_ControlAdded(ByVal sender As Object, ByVal e As ControlEventArgs)

If TypeOf e.Control Is Syncfusion.Windows.Forms.Tools.DockingWrapperForm Then

Console.WriteLine("Docking window to MDIChild transition")

End If

End Sub

Protected Sub MDIClient_ControlRemoved(ByVal sender As Object, ByVal e As ControlEventArgs)

If TypeOf e.Control Is Syncfusion.Windows.Forms.Tools.DockingWrapperForm Then

Console.WriteLine("MDIChild to Docking window transition")

End If

End Sub

Sample:

http://help.syncfusion.com/support/samples/kb/Tools.Windows/TDSTrans/StateTransition.zip

Article ID: Published Date: Last Revised Date: Platform: Control:
1044 04/30/2011 07/10/2014 WinForms DockingManager
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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