frmWeixin Weixin = new frmWeixin();
if (Application.OpenForms["frmWeixin"] == null)
{
Weixin.Show();
}
else
Application.OpenForms["frmWeixin"].Show();
點擊button1, 下載資料,資料更新后,
需要自動關閉視窗 frmWeixin 然后又打開,該怎么寫代碼實作呢?謝謝
uj5u.com熱心網友回復:
在frmWeixin 的FormClosing事件中,執行如下操作:e.Cancel = true;
this.Hide();
即關閉表單的時候其實就是隱藏,需要的時候再次show一下就可以了
uj5u.com熱心網友回復:
private void button1_Click(object sender, EventArgs e){
frmWeixin wx = new frmAlternatve();
if (Application.OpenForms["frmWeixin"] == null)
{
wx.Close();
}
else
Application.OpenForms["frmWeixin"].Close();
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/206230.html
標籤:C#
上一篇:C#表單怎么獲取用戶控制元件的值
下一篇:執行程式的著作權資訊怎樣修改呢?
