Hi Serguei,
When a FloatingForm is closed, Form's visibility is set to false. The form can be reopened using dockingManager.SetDockVisibility( form , true ). This is the reason for not firing the FormClosed event. When application is closed, Form is disposed. So FormClosed event is fired.
How to handle FormClosed event?
Whenever the control visibility is changed, DockVibilityChanged event is fired. So we could initiate user defined event in this handler to achieve our requirement.
Here is the code snippet:
public delegate void FormClosed(Object sender , Syncfusion.Windows.Forms.Tools.DockVisibilityChangedEventArgs e );
public event FormClosed FormClosedEvent;
private void dockingManager1_DockVisibilityChanged(object sender, Syncfusion.Windows.Forms.Tools.DockVisibilityChangedEventArgs arg)
{
if (!this.dockingManager1.GetDockVisibility(arg.Control) &&
this.dockingManager1.IsFloating(arg.Control))
{
this.FormClosedEvent += new FormClosed(Form1_FormClosedEvent);
this.FormClosedEvent(sender, arg);
}
}
void Form1_FormClosedEvent(object sender, Syncfusion.Windows.Forms.Tools.DockVisibilityChangedEventArgs e)
{
Console.WriteLine(e.Control.Name);
}
Herewith I have also attached the sample. Please have a look at the sample and let me know if it helps.
TDM_55889Thanks for choosing Syncfusion products.
Regards,
Murugan P.S