当我的孩子在父表单下加载表单时,它会在父表单标题中显示其标题。有没有办法在父标题中隐藏子表单标题而不将子标题留空?
答案 0 :(得分:1)
您可以检查表单是否为getting maximized,然后在该状态下删除表单的Text属性:
private string formText = string.Empty;
protected override void WndProc(ref Message m) {
if (m.Msg == 0x0112) {
if (m.WParam == new IntPtr(0xF030)) {
formText = this.Text;
this.Text = string.Empty;
} else {
this.Text = formText;
}
}
base.WndProc(ref m);
}
答案 1 :(得分:-1)
在form1中更改ISMDIContainer = True
和load form2:
Form2 form2 = new Form2();
form2.MdiParent = this;
form2.Show();