且构网

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

停止在C#.Net的父窗体顶部的顶部显示MDI子窗体名称?

更新时间:2023-12-06 09:05:28

您可以检查表单是否获得最大化,然后在该状态下删除表单的Text属性:

You can check to see if the form is getting maximized and then erase the form's Text property in that state:

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);
}