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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Floating window position

Thread ID:

Created:

Updated:

Platform:

Replies:

10786 Feb 12,2004 06:19 AM UTC Feb 13,2004 12:25 PM UTC WinForms 2
loading
Tags: Tools
Jonas Ekstrom
Asked On February 12, 2004 06:19 AM UTC

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

Administrator [Syncfusion]
Replied On 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.

Jonas Ekstrom
Replied On 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.

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.

Warning Icon 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.Close Icon

;