以下为部分代码.点击菜单触发下面的事件.
public void menu_click(object sender, System.EventArgs e)
{
string itemname,windowname;
itemname=((MenuItem)sender).Text.ToString();
windowname=this.checkwindowname(itemname);
if (this.checkChildFrmExist("windowname") == true)
{
return;
}Form form = null;
string strtype="grm."+windowname;
Type type = Type.GetType(strtype);
form = (Form) Activator.CreateInstance(type);
//form.MdiParent = this;
form.Text=itemname;
form.Show();
}
第一个问题:当我把注释行取消注释后,为什么打开的窗口就不可见,就象隐藏了一样.在父窗口的菜单上可以看到该窗口.
第二个问题:c#中数组是否一定要先分配空间大小?能否象PB那样动态的往数组中加数据,不用先分配空间大小.
public void menu_click(object sender, System.EventArgs e)
{
string itemname,windowname;
itemname=((MenuItem)sender).Text.ToString();
windowname=this.checkwindowname(itemname);
if (this.checkChildFrmExist("windowname") == true)
{
return;
}Form form = null;
string strtype="grm."+windowname;
Type type = Type.GetType(strtype);
form = (Form) Activator.CreateInstance(type);
//form.MdiParent = this;
form.Text=itemname;
form.Show();
}
第一个问题:当我把注释行取消注释后,为什么打开的窗口就不可见,就象隐藏了一样.在父窗口的菜单上可以看到该窗口.
第二个问题:c#中数组是否一定要先分配空间大小?能否象PB那样动态的往数组中加数据,不用先分配空间大小.
http://blog.csdn.net/zhzuo/archive/2006/05/05/708941.aspx
第二个问题:
使用ArrayList类代替数组。
子窗体要设置什么属性吗?
并非不可见,而是被MDI窗体挡住了,可使用Form.BrindToFront方法