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. Image for the cookie policy date
close icon

Docking and Activated event problem (4.4.0.55)

Trying to dock form

formToFloat.TopLevel = false;
formToFloat.ShowInTaskbar = false;
formToFloat.FormBorderStyle = FormBorderStyle.None;
this.FloatControl(formToFloat, formToFloat.Bounds);


Docking is succeeded but after docking formToFloat not handled event Activated.

How to avoid this problem ?

Thanks

8 Replies

MU Murugan Syncfusion Team January 31, 2007 06:53 PM UTC

Hi Serguei,

Form.Activated event is fired only when Form.TopLevel = true. If we set Form.TopLevel = false, Form.Activated is not called because TopLevel controls only have this event.

As a workaround, please use dockingManager1_DockControlActivated event. It is fired when the docked control got focus.

private void dockingManager1_DockControlActivated(object sender, Syncfusion.Windows.Forms.Tools.DockActivationChangedEventArgs arg)
{
Console.WriteLine( this.dockingManager1.GetDockLabel( arg.Control ) );
}

Please let me know if it helps you.

Thanks for using Syncfusion products.

Regards,

Murugan P.S


ST Serguei Tarassov February 1, 2007 10:09 AM UTC

Murugan,

thanks for help.

As I tested your suggestion, "DockControlActivated" event is fired only once when you do
FloatControl(formToFloat, formToFloat.Bounds);
After that, when you switch between the main form and floated form, no event is fired.

What event of docking manager is more suitable in this case ?

regards,
Serguei


ST Serguei Tarassov February 1, 2007 02:06 PM UTC

Murugan,

Some comments on this.
When watching floated window with Spy++, you should see that it receive message WM_ACTIVATE.
I hope, to avoid using direct hook, there is an suitable event in Syncfusion.

Regards,
Serguei


MU Murugan Syncfusion Team February 1, 2007 10:56 PM UTC

Hi Serguei,

DockControlActivated event is fired, whenever the docked control is activated. We have checked the issue with v4.4. It is working fine.

Could you please let me know the Essential Studio version details and steps to reproduce the issue? This will help us to analyse the issue further.

Thanks,
Murugan P.S


ST Serguei Tarassov February 2, 2007 09:50 AM UTC

Murugan,

thanks for help.

There are the steps to reproduce:
1. Create new WinForms application.
2. Drop DockingManager on the main form (Form1)
3. Add another form to application (Form2)
4. Drop ToolStrip to Form1, add the button to it and write the "Click" handler:

private void toolStripButton1_Click(object sender, EventArgs e)
{
Form2 formToFloat = new Form2();
formToFloat.Text = "Floating form";
formToFloat.TopLevel = false;
formToFloat.ShowInTaskbar = false;
formToFloat.FormBorderStyle = FormBorderStyle.None;
dockingManager1.FloatControl(formToFloat, formToFloat.Bounds);
formToFloat.TopLevelControl.Text = "Floating form";
}



I attached the resulting screenshot also.


Regards,
Serguei

form-activate.zip


MU Murugan Syncfusion Team February 2, 2007 04:10 PM UTC

Hi Serguei,

Thanks for your sample and detailed reproducing steps.

This is not an issue. When only one control is docked, it is an ActiveControl even it is not focused. When parentform is selected only focus is changed not the ActiveControl. This is the reason for not firing DockControlActivated event.

Please have a look at the sample and let me know if you need further assistance.

TDM_55534

Thanks,
Murugan P.S


AD Administrator Syncfusion Team February 6, 2007 05:48 PM UTC

Murugan,

thanks for help.

We choose to delegate ebent handling to floating form, that's OK with "Activate" but "Closed" event seems not working.

http://www.syncfusion.com/support/forums/message.aspx?&MessageID=55889

Regards,
Serguei


MU Murugan Syncfusion Team February 6, 2007 06:33 PM UTC

Hi Serguei,

Thanks for your update.

I have updated the forum

http://www.syncfusion.com/support/forums/message.aspx?&MessageID=55889

Please have a look at this.

Thanks,
Murugan P.S

Loader.
Live Chat Icon For mobile
Up arrow icon