Articles in this section
Category / Section

How to display a floating form as a model dialog form in WinForms Docking Manager?

1 min read

Notify dock state change

The floating form does not support the Modal Dialog form. But we can solve it by toggling the Host form's Enabled property. While the DockStateChanged Event is being executed, the Enabled property of the HostForm must be disabled to display a Floating Form as a Modal Dialog form. The following code snippet illustrates this functionality.

C#

private void dockingManager1_DockStateChanged(object sender, Syncfusion.Windows.Forms.Tools.DockStateChangeEventArgs arg)
{
   if (this.dockingManager1.IsFloating(this.panel1))
   {
      this.Enabled=false;
      this.dockingManager1.SetDockLabel(this.panel1,"Modal Floating Form");
   }
   else
   {
      this.Enabled=true;
      this.dockingManager1.SetDockLabel(this.panel1,"Docking Form");
   }
}

 

VB

Private Sub dockingManager1_DockStateChanged(ByVal sender As Object, ByVal arg As Syncfusion.Windows.Forms.Tools.DockStateChangeEventArgs) Handles dockingManager1.DockStateChanged
    If Me.dockingManager1.IsFloating(Me.panel1) Then
       Me.Enabled=False
       Me.dockingManager1.SetDockLabel(Me.panel1,"Modal Floating Form")
    Else
       Me.Enabled=True
       Me.dockingManager1.SetDockLabel(Me.panel1,"Docking Form")
    End If
End Sub

 

UG document link: https://help.syncfusion.com/windowsforms/dockingmanager/docking-events#notify-dock-state-change

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied