MDI的子窗体一旦最大化后,子窗体的图标就越过菜单栏跑到最上面去了
我使用VS2005,编译的MDI程序,其子窗体一旦最大化后,子窗体的图标就越过菜单栏跑到最上面去了,他的位置高过了菜单栏,弄的界面很难看。哪位GGJJ不吝赐教啊?
我想实现的效果是点击出现子画面是location 是screemcenter,点击最大化按钮的时候实现成dock.Fill的那种效果。现在我捕获到最大化事件,
if (m.WParam.ToInt32() == SC_MAXIMIZE)
{
this.Location = new Point(0, 0);
Size s = new Size(System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width, System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height);
this.Size = s;
return;
}这段代码根本不起作用!哪位高手帮忙看看!在线等!
我使用VS2005,编译的MDI程序,其子窗体一旦最大化后,子窗体的图标就越过菜单栏跑到最上面去了,他的位置高过了菜单栏,弄的界面很难看。哪位GGJJ不吝赐教啊?
我想实现的效果是点击出现子画面是location 是screemcenter,点击最大化按钮的时候实现成dock.Fill的那种效果。现在我捕获到最大化事件,
if (m.WParam.ToInt32() == SC_MAXIMIZE)
{
this.Location = new Point(0, 0);
Size s = new Size(System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width, System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height);
this.Size = s;
return;
}这段代码根本不起作用!哪位高手帮忙看看!在线等!
f.TopLevel = false;
f.Dock = DockStyle.Fill;
f.WindowState = FormWindowState.Maximized;
this.Controls.Add(f);
f.Show();
xtraTabbedMdiManager1.MdiParent = this;
xtraTabbedMdiManager1.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Top;另外 感觉
Form f = new Form();
f.TopLevel = false;
f.Dock = DockStyle.Fill;
f.WindowState = FormWindowState.Maximized;
this.Controls.Add(f);
f.Show();楼上的这个 方法 也是可行的
//form1.TopLevel = false;
//form1.Dock = DockStyle.Fill;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Show();
我那个在窗口最大化的时候无法设置窗口大小,是不是因为子窗体的边框设为sizeable了?有没有好点的办法?
form1.MdiParent = mdiform; 不设置MdiParent,子窗体就不是Mdi子窗体了。用AddOwnerForm,Controls.Add等方法都可以实现。而设置了MdiParent后就显示成你说的那个样子 了。