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 and MDI client size

Thread ID:

Created:

Updated:

Platform:

Replies:

13611 May 4,2004 06:07 AM Jun 2,2006 12:26 AM Windows Forms 9
loading
Tags: Tools
Peter
Asked On May 4, 2004 06:07 AM

I have an MDI parent form on which I placed a left-docked treeview with the docking manager. Now I want to open a MDI child form, which fits in the remaining client area (the area between the right border of the docked control and the right border of the MDI parent form). But if I retrieve the client size from the "ClientSize" property of the parent form, I don''t get the right width). Is there a way to get the right client size? I''m using version 1.6.1.8. Regards Peter

Administrator [Syncfusion]
Replied On May 4, 2004 09:37 AM

Hi Peter, Do you wish to display the MDI child form as a tabbed MDI ? If so, the tabbed MDI child automatically fills the space available on the parent form. You would have to only host an instance of the TabbedMDIManager within the parent form for this purpose, and no calculation of the client area would be required. Please let me know about it. We appreciate your cooperation. Regards, Guru Patwal Syncfusion, Inc.

Peter
Replied On May 4, 2004 10:27 AM

No, I don''t want to display it as a TabbedMDI. I only want to display a normal MDI child form, non-maximized, in the remaining client area of the MDI parent form and fit the size of the child form to the size of the client area. But I can''t do: ChildForm.width = ParentForm.ClientSize.Width Because the width (or height) of the ClientSize includes the width of the docked controls.

Administrator [Syncfusion]
Replied On May 4, 2004 12:12 PM

Hi Peter, An easy way to find out the vacant client area of the form is to drop a DockingClientPanel onto the main form and setting its SizeToFit property to true. The DockingClientPanel resizes itself to fill the entire vacant space. Now the dimensions of the DockingClientPanel will give you the bounds of the vacant space. Remove this DockingClientPanel from the main form once the bounds are got. I have created a sample_application which illustrates this and have attached it here. Please refer to it and let me know if this meets your requirements. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On May 5, 2004 03:38 AM

Thanks for the sample. But that doesn''t work because the MDI parent is already set to MDI container and therefore you can''t set docking style to "fill". But I did it another way: I took the clientsize and subtracted the widths, heights of the menubars, the toolbars, the statusbar, and the docked controls - including the borders. Was a lot of work but it works.

Administrator [Syncfusion]
Replied On May 5, 2004 05:57 AM

Hi, Thanks for the update. Please refer to the code snippet taken from my sample : childSize = this.dockingClientPanel1.Size; // remove the DockingClientpanel after getting the bounds this.Controls.Remove(this.dockingClientPanel1); this.dockingClientPanel1.Dispose(); // set to true only after dockingClientPanel1 is removed this.IsMdiContainer = true; mdichild = new Form(); mdichild.Text = "MDI Child Form"; // 4 pixels have to be deducted from the width and height to account // for the width of the right and lower borders of the main form mdichild.Size = new Size(childSize.Width-4, childSize.Height-4); mdichild.MdiParent = this; mdichild.Show(); The main form''s IsMdiContainer property is set to false in the designer initially. Hence it is possible to to set the DockingClientPanel''s SizeToFit property to true. IsMdiContainer property is set to true in code only after the DockingClientPanel has been removed from the form. However, we are glad that you could workaround this problem using another approach. Please let me know if you need any other information. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Anthony
Replied On May 18, 2004 12:29 PM

If we could get to this.dockingManager.dcHostForm.rcClientPool then we dont have to recalculate.

Administrator [Syncfusion]
Replied On May 18, 2004 08:32 PM

Hi Anthony, Thanks for your suggestion. I have conveyed this to the development team, and we may consider this as a feature request for a future release of Essential Suite. We appreciate your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Erik
Replied On June 1, 2006 01:43 PM

wish to display the MDI child form as a tabbed MDI. Can you show me how? >Hi Peter, > >Do you wish to display the MDI child form as a tabbed MDI ? If so, the tabbed MDI child automatically fills the space available on the parent form. You would have to only host an instance of the TabbedMDIManager within the parent form for this purpose, and no calculation of the client area would be required. Please let me know about it. We appreciate your cooperation. > >Regards, >Guru Patwal >Syncfusion, Inc.

Administrator [Syncfusion]
Replied On June 2, 2006 12:26 AM

Hi Erik, Thanks for using Essential tools. I have attached a sample for your requirement: TabbedMDI.zip Please take a look and let me know if this helps you. Best Regards, Seetha

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.

;