日期:2014-05-17 浏览次数:20887 次
public delegate void MDIButton(string BT);父窗体中:
public MDIButton ShowButton;
public MDIButton AddButton;
private void Login_FormClosing(object sender, FormClosingEventArgs e)
{
string BT = "";
if (Program.Tools != null){ AddButton(BT); }
else { ShowButton(BT); }
}
private void MDILogin_Click(object sender, EventArgs e)
{
Login f2 = new Login();
f2.ShowButton += new Login.MDIButton(ShowButton_Method);
f2.AddButton += new Login.MDIButton(AddButton_Method);
f2.Owner = this;
MLogin.Visible = false;
f2.ShowDialog();
}
public void ShowButton_Method(string sButton)
{
MLogin.Visible = true;
}
public void AddButton_Method(string aButton)
{
this.MTools.Nodes.Clear();
this.MTools.ImageList = this.MTicon;
TreeNode nodeParent;
for (int i = 0; i < Program.Tools.Count; i = i + 3)
{
nodeParent = this.MTools.Nodes.Add("", Program.Tools[i].ToString(), "TWait", "TSelect");
}
}