如何以子格式启用菜单条?
我只想在关闭子表单时启用菜单按钮条 如何以子格式编码?
学生....
private void tsmNewEmp_Click(object sender, EventArgs e)
{
if(NewEmp == null)
{
NewEmp = new NewEmployee();
NewEmp.MdiParent = this;
}
NewEmp.Show();
tsmNewEmp.Enabled = false;
tsmNewContract.Enabled = false;
}
答案 0 :(得分:0)
您可以在儿童关闭后使用FormClosed事件更新父表单中的按钮:
private void tsmNewEmp_Click(object sender, EventArgs e)
{
if(NewEmp == null)
{
NewEmp = new NewEmployee();
NewEmp.MdiParent = this;
NewEmp.FormClosed += FormClosed_1;
}
NewEmp.Show();
tsmNewEmp.Enabled = false;
tsmNewContract.Enabled = false;
}
private void FormClosed_1(object sender, FormClosedEventArgs e)
{
tsmNewEmp.Enabled = true;
tsmNewContract.Enabled = true;
}
答案 1 :(得分:0)