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

Docking Manager and MDI client size

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

9 Replies

AD Administrator Syncfusion Team May 4, 2004 01:37 PM UTC

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.


PE Peter May 4, 2004 02:27 PM UTC

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.


AD Administrator Syncfusion Team May 4, 2004 04:12 PM UTC

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.


AD Administrator Syncfusion Team May 5, 2004 07:38 AM UTC

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.


AD Administrator Syncfusion Team May 5, 2004 09:57 AM UTC

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.


AN Anthony May 18, 2004 04:29 PM UTC

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


AD Administrator Syncfusion Team May 19, 2004 12:32 AM UTC

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.


ER Erik June 1, 2006 05:43 PM UTC

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.


AD Administrator Syncfusion Team June 2, 2006 04:26 AM UTC

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

Loader.
Up arrow icon