久久亚洲精品国产精品_羞羞漫画在线版免费阅读网页漫画_国产精品久久久久久久久久久久_午夜dj免费观看在线视频_希崎杰西卡番号

dialogresult(dialogresult不讓他一直彈窗)

前沿拓展:

dialogresult

樓上的說的挺仔細了,這是一個例子,運行下就知道了.

string message = “You did not enter a server name. Cancel this operation?”;

string caption = “No Server Name Specified”;

MessageBoxButtons buttons = MessageBoxButt石編至型刻幾步酸ons.YesNo;

DialogResult

拓展知識:

dialogresult

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
MessageBox.Show("提示?", "是否確認退出?",MessageBoxButtons.OKCancel,MessageBoxicon.information)

}
其實不用判斷.點擊窗口右上角的X,會彈出對話框,如果選擇是OK的話,會關(guān)閉窗口,點取消相當與什么都沒做

dialogresult

this.Dispose(); //釋放資源
this.Close(); //關(guān)閉程序(窗口)

dialogresult

取消按鈕是自己設(shè)計的話,直接把form 的cancel result button設(shè)置成這個button;
或者在點擊button的時候this.dialogresult=cancel;

dialogresult

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("確定關(guān)閉窗口?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
e.Cancel = true;
}
}

原創(chuàng)文章,作者:九賢生活小編,如若轉(zhuǎn)載,請注明出處:http://www.cddhlm.com/33436.html