且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

单击最大化父级MDI表单时如何在MDI child子中实现控件

更新时间:2023-10-09 11:48:34

您还没有告诉您要调整多少尺寸.但是,如果您已将datagridview的DockStyle设置为填充子表单(即如果Datagridview.DockStyle= DockStyle.Fill),则在最大化或调整子表单的大小时将自动调整其大小.

You haven''t told how much you want to resize. But if you have set DockStyle of datagridview to fill up the child form(i.e, if Datagridview.DockStyle= DockStyle.Fill), then it will be automatically resized when you maximize or resize the childform.

private void parentForm_resize(...)
{
Childform.size= Parentform.size;
}




每个控件锚都有一个属性
将控件的anchor属性设置为All

并将属性Dock更改为Fill
Hi,

There is a property for each control Anchor
Set the control''s anchor property to All

And also change the property Dock to Fill