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.
Unfortunately, activation email could not send to your email. Please try again.

Docking and Activated event problem (4.4.0.55)

Thread ID:

Created:

Updated:

Platform:

Replies:

55534 Jan 31,2007 12:28 PM Feb 6,2007 01:33 PM Windows Forms 8
loading
Tags: Tools
Serguei Tarassov
Asked On January 31, 2007 12:28 PM

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

Murugan [Syncfusion]
Replied On January 31, 2007 01:53 PM

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

Serguei Tarassov
Replied On February 1, 2007 05:09 AM

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

Serguei Tarassov
Replied On February 1, 2007 09:06 AM

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

Murugan [Syncfusion]
Replied On February 1, 2007 05:56 PM

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

Serguei Tarassov
Replied On February 2, 2007 04:50 AM

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

Murugan [Syncfusion]
Replied On February 2, 2007 11:10 AM

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

Administrator [Syncfusion]
Replied On February 6, 2007 12:48 PM

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

Murugan [Syncfusion]
Replied On February 6, 2007 01:33 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;