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 manager floating

Thread ID:

Created:

Updated:

Platform:

Replies:

37844 Dec 1,2005 02:25 AM Dec 1,2005 09:31 AM Windows Forms 6
loading
Tags: Tools
Administrator [Syncfusion]
Asked On December 1, 2005 02:25 AM

I have an application that uses docking manager to dock the forms. I need to resize the form when the form is floating (only when the form is floating) and position it in the centre of the screen. Kindly let me know how to do this

Vijayanand S [Syncfusion]
Replied On December 1, 2005 07:09 AM

Hi Rohith, 1. We can achieve non-resizable docking windows by setting the FreezeResize property to true. Currently, Syncfusion Docking manager can only support this property for all docked controls. So it is not possible to resize the window only for floating forms since docking and floating windows are controlled by the docking manager. We have already logged a feature request for this. I will increase the priority to address this issue soon. FreezeResize property for Each docking control 2. We can get the floating form properties using the following code snippet. DockHost dhost = dockedform as Syncfusion.Windows.Forms.Tools.DockHost; FloatingForm floatfrm = dhost.ParentForm as FloatingForm; floatfrm.Location=new Point(this.Size.Width/2-floatfrm.Width/2,this.Size.Height/2-floatfrm.Height/2); This allows you to easily change the location of the floating window. If you want to locate the window at the center whenever it changes from docking to floating, you can give the above coding in the DockStateChanged event. Please take a look at the attached sample which illustrates the above functionality and let me know if you have any questions. Thanks for your interest in Syncfusion products. Regards, Vijay Test Sample

Administrator [Syncfusion]
Replied On December 1, 2005 07:31 AM

Hi Vijay, Thanks. The sample changes the position to the centre of the screen on floating. but When I again Dock this control, the application it throws an exception.I need the ability to Dock and float the control whenever i need, at the same time when the form is floating I need to position it at the centre of screen.Kindly let me know the work around for this. Regards Rohith

Vijayanand S [Syncfusion]
Replied On December 1, 2005 07:47 AM

Hi Rohith, I am afraid, I was not able to reproduce your problem. Please clarify me the following: 1. Are you getting the exception by double clicking on the caption bar of the docking window? 2. Or, Do you use to redock and float the window by programmatically? If yes, Could you please provide me the code snippet? 3. And also can you send me the stack trace of the exception? Thanks for using Syncfusion Products. Regards, Vijay

Administrator [Syncfusion]
Replied On December 1, 2005 08:00 AM

Hi Vijay, I make the window floating by using the context menu option. (By right clicking on the title bar of the Docked form). Now when the form is floating and it is in the centre of the screen, I again right click on the title bar and using context menu option i choose the Dockable option.(Now the Dockable menu item will be tick marked in the context menu). Then again I choose the Dockable option. Now the application throws an exception.(object reference not set to an instance of an object in dockingManager1_DockStateChanged event handler). This problem does not occur when i double click on the title bar. Thanks Rohith.

Vijayanand S [Syncfusion]
Replied On December 1, 2005 09:12 AM

Hi Rohith, Sorry for the inconvenience. I have missed one condition to include in my sample. You could replace the following code instead of the old one. private void dockingManager1_DockStateChanged(object sender, Syncfusion.Windows.Forms.Tools.DockStateChangeEventArgs arg) { //Returns the boolean value whether it is floating or not. if(this.dockingManager1.IsFloating(arg.Controls[0])&& !(arg.Controls[0].Parent is DockingWrapperForm)) { //You could change the location or any other floating form properties. DockHost dhost = arg.Controls[0].Parent as Syncfusion.Windows.Forms.Tools.DockHost; FloatingForm floatfrm = dhost.ParentForm as FloatingForm; floatfrm.Location=new Point(this.Size.Width/2-floatfrm.Width/2,this.Size.Height/2-floatfrm.Height/2); } } Please let me know how it goes. Thanks for your cooperation. Regards, Vijay

Administrator [Syncfusion]
Replied On December 1, 2005 09:31 AM

Thanks Vijay. It helps

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.

;