当我关闭子表单时,我正在尝试启用/可见为true。 这是我的示例代码。 我将不胜感激你的帮助。
//This code works perfectly
private void TSBRekrytering_Click(object sender, EventArgs e)
{
FrmRekrytering RekryteringForm = new FrmRekrytering();
RekryteringForm.MdiParent = this;
RekryteringForm.Show();
//Hide toolstrip for the FrmMain or MDI Parent Form
TSFrmMain.Visible = false;
}
但是当我关闭FrmRekrytering
我想启用主窗体(即 MDI 窗体)的工具行程。
再次感谢。
在父窗体中添加此代码
private void TSBRekrytering_Click(object sender, EventArgs e)
{
FrmRekrytering RekryteringForm = new FrmRekrytering();
RekryteringForm.Show(this);
TSFrmMain.Visible = false;
}
public string toolstripvalue
{
get
{
return toolstripvalue;
}
set
{
toolStrip.Visible = Convert.ToBoolean(value);
}
}
和这个子形式的代码,即FrmRekrytering。
protected override void OnFormClosing(FormClosingEventArgs e)
{
((MDIParent1)this.Owner).toolstripvalue = "true";
}