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 188.8.131.52.
ADAdministrator Syncfusion Team May 4, 2004 08:37 AM
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.
PEPeterMay 4, 2004 09: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.
ADAdministrator Syncfusion Team May 4, 2004 11:12 AM
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.
ADAdministrator Syncfusion Team May 5, 2004 02: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.
ADAdministrator Syncfusion Team May 5, 2004 04:57 AM
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
// 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;
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.
ANAnthonyMay 18, 2004 11:29 AM
If we could get to
then we dont have to recalculate.
ADAdministrator Syncfusion Team May 18, 2004 07:32 PM
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.
ERErikJune 1, 2006 12:43 PM
wish to display the MDI child form as a tabbed MDI.
Can you show me how?
>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.
ADAdministrator Syncfusion Team June 1, 2006 11:26 PM
Thanks for using Essential tools.
I have attached a sample for your requirement:
Please take a look and let me know if this helps you.