I have written code that will resize a Control and all of its controls, but there's a problem with the PropertyGrid. The user interface is a GroupBox that contains the TabControl tabContAll. In tabContAll is a TabPage that contains a PropertyGrid.
private void ResizeUI ()
{
ui.Location = new Point (this.ClientRectangle.Left, this.ClientRectangle.Top + menubar.Height);
ui.Size = new Size (this.ClientRectangle.Width, this.ClientRectangle.Height - menubar.Height);
ResizeControl (tabContAll, ui);
}
private void ResizeControl (Control control, Control parent)
{
control.Location = new Point (parent.ClientRectangle.Left, parent.ClientRectangle.Top);
control.Size = new Size (parent.ClientRectangle.Width, parent.ClientRectangle.Height);
foreach (Control child in control.Controls) {
ResizeControl (child, control);
}
}
This function is called when the form loads, and this is what it looks like compared to if I commented out the resizing in the loop so the PropertyGrid doesn't get resized:


Furthermore when it is resized, the description doesn't work. It just shows the name of the property.
DockingandAnchoringof the winforms controls - Samich