停止在C#.Net的父窗体顶部的顶部显示MDI子窗体名称? [英] Stop Displaying MDI Child form Name in Top OF Parent Form in C#.Net?

查看:68
本文介绍了停止在C#.Net的父窗体顶部的顶部显示MDI子窗体名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的子表单加载到父表单下时,它会在父表单标题中显示其标题.有什么方法可以在不将子标题保留为空白的情况下在父标题中隐藏子表单标题?

When my child form load under parent form it displays its title in the parent form title. Is there any way to hide the child form title in the parent title without leaving the child title blank?

推荐答案

您可以检查表单是否获得最大化,然后在该状态下删除表单的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);
}

这篇关于停止在C#.Net的父窗体顶部的顶部显示MDI子窗体名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆