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

Floating window position

Hi, I have a problem with location of floating controls. I''m adding a System.Windows.Forms.Panel using FloatControl method in DockingManager. dockingManager.FloatControl(myPanel, new Rectangle(myLocation, mySize)); After the call I need to get the current position of the floating control, reading the myPanel.Location attribute. That value is incorrect, should be something else then {1,1}. What am I doing wrong? regards, Jonas

2 Replies

AD Administrator Syncfusion Team February 12, 2004 11:01 AM UTC

Hi Jonas, Thw floating window is a complex structure consisting of the FloatingForm, the DockHost and the Control itself. The FloatingForm is the outermost Container, which hosts a DockHost Container in it. The DockHost Container in turn hosts the Control. The Location of the DockHost is relative to that of the FloatingForm, and the Location of the Control is relative to that of the DockHost. So the Location of the Control will always be {1,1} since the Control is never pulled out of the DockHost and hence the relative position of the two remains constant. You would have to get the Location of the FloatingForm to get the correct Location of the floating window on the screen. This could be done as shown in the code below : this.dockingManager1.FloatControl(this.panel1, new Rectangle(this.Location,this.Size)); this.dhost = this.panel1.Parent as Syncfusion.Windows.Forms.Tools.DockHost; this.frmfloat = dhost.ParentForm as FloatingForm; Now this.frmfloat.Location gives the exact Location of the floating window. Please refer to the sample attached here which illustrates this, and let me know if you need any other information. Thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


JE Jonas Ekstrom February 13, 2004 12:25 PM UTC

works like a charm thank you Guru >Hi Jonas, > >Thw floating window is a complex structure consisting of the FloatingForm, the DockHost and the Control itself. The FloatingForm is the outermost Container, which hosts a DockHost Container in it. The DockHost Container in turn hosts the Control. The Location of the DockHost is relative to that of the FloatingForm, and the Location of the Control is relative to that of the DockHost. So the Location of the Control will always be {1,1} since the Control is never pulled out of the DockHost and hence the relative position of the two remains constant. > >You would have to get the Location of the FloatingForm to get the correct Location of the floating window on the screen. This could be done as shown in the code below : > >this.dockingManager1.FloatControl(this.panel1, new Rectangle(this.Location,this.Size)); > >this.dhost = this.panel1.Parent as Syncfusion.Windows.Forms.Tools.DockHost; > >this.frmfloat = dhost.ParentForm as FloatingForm; > >Now this.frmfloat.Location gives the exact Location of the floating window. Please refer to the sample attached here which illustrates this, and let me know if you need any other information. Thanks for choosing Syncfusion products. > >Regards, >Guru Patwal >Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon