C# 一个MDI窗体怎样在加载子窗体时,使子窗体为最大化,我的windowstate属性设置了的啊代码如下
click的
Addofficer Addofficer1 = new Addofficer();
Addofficer1.MdiParent = this;
Addofficer1.Show();
Addofficer1的:
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = FormBorderStyle.None;
this.ControlBox = false;
this.Menu = null;
click的
Addofficer Addofficer1 = new Addofficer();
Addofficer1.MdiParent = this;
Addofficer1.Show();
Addofficer1的:
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = FormBorderStyle.None;
this.ControlBox = false;
this.Menu = null;
解决方案 »
- 怎样使datagridview在输入完一行后,禁止自动新增一行?
- c#使用SmtpMail发送一封邮件给多个邮件地址,其中有一个邮件地址不正确,则所有邮件都无法收到怎么回事 如果邮件地址都正确,则可以发
- 这里哪错了
- adapter.Update()违反并发性
- 請教大家一個 DataGridView多列下拉的問題
- using System.Runtime.Remoting.Channels.点后面怎么不出现Tcp?
- 有关第三方控件GridControl绑定后更新数据集的问题。
- 谁能给我用Oledb完整调用“存储过程”的代码?
- 怎样把12345分钟表示成hhh:mm:ss??
- 在Winform中如何限定TextBox,只让用户写入数字,而不能录入字符
- 设计象棋类,该考虑有哪些成员?
- .NET 3.0 中操作剪贴板出现CLIPBRD_E_CANT_OPEN错误
Addofficer1.MdiParent = this;
Addofficer1.WindowState = FormWindowState.Maximized;
Addofficer1.Show();
Addofficer Addofficer1 = new Addofficer();
Addofficer1.MdiParent = this;
Addofficer1.WindowState = FormWindowState.Maximized;
Addofficer1.Show();
Addofficer1.MdiParent = this;
Addofficer1.WindowState = FormWindowState.Maximized;
Addofficer1.Show();然后把Addofficer1窗体里面的属性改回Normal!!具体为什么我也没搞清楚,就是在窗体里面改成Maximized后就无法放大的
///打开子窗体
///</summary>
public static void openChildrenWindow(System.Windows.Forms.Form parentWindow, System.Windows.Forms.Form childrenWindow)
{
foreach (System.Windows.Forms.Form ff in parentWindow.MdiChildren)
{
//如果子窗体存在,激活子窗体
if (ff.Name == childrenWindow.Name)
{
ff.Activate();
ff.Size = ff.Parent.Size;
ff.WindowState = System.Windows.Forms.FormWindowState.Maximized;
((frmMain)parentWindow).slblOperate.Text = ff.Text; return;
}
}
parentWindow.IsMdiContainer = true;
childrenWindow.MdiParent = parentWindow;
childrenWindow.WindowState =System.Windows.Forms.FormWindowState.Maximized;
childrenWindow.Show();
//childrenWindow.ControlBox = false;
}调用 openChildrenWindow(this, new form());//this parentWindow,form要打开的窗体
Modifyclass Modifyclass1 = new Modifyclass();
Modifyclass1.MdiParent = this;
Modifyclass1.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ActivateMdiChild(Modifyclass1);
Modifyclass1.Show();
我找同学改成这样就行了,,现在过来看看,txt_ly说得很好啊,,分数就给你吧,,。。谢谢咯。。
ff.Size = ff.Parent.Size; //只是实现子窗体的大小与其父窗体一样大!
但是不能铺满啊,不知各位仁兄还有什么高招啊,指点小弟一二!感激不尽!
Modifyclass1.MdiParent = this;
Modifyclass1.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ActivateMdiChild(Modifyclass1);
Modifyclass1.Show(); 楼上的这个方法是可以的,感谢!但这一句“this.ExistChildForm()“;好像不存在??