我有一些消息框,我這樣的代碼:C#,Windows窗體,消息框頂部不工作
MessageBox.Show(new Form(){TopMost=true, TopLevel=True}, "Message","Title", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
對於一個更好的例子,我這樣做對的FormClosing事件:
private void Example_FormClosing(object sender, FormClosingEventArgs e){
MessageBox.Show(new Form(){TopMost=true, TopLevel=True}, "Really close?"," Program", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
}
但是,幾乎每次我在看到我的消息箱之前都要更改我的計算機上的Window(比如返回Visual Studio),並且它不便於用戶使用並且非常煩人。
我證實我的主體形式不是TopMost = true,我只是嘗試了TopMost或者只是TopLevel,StartPosition = FormStartPosition.CenterScreen,但沒有任何工作。
[更新]
我想:
private void Example_FormClosing(object sender, FormClosingEventArgs e){
MessageBox.Show(this.Owner, "Really close?"," Program", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
}
我想對我的窗前我的消息框,並沒有改變窗口看到它,因爲它是就像當前窗口後面一樣。
你有想法解決這個問題嗎?
請更清楚,不知道你在問什麼。 – Harish 2013-04-09 11:51:43
你想實現什麼?業主需要先顯示 – Max 2013-04-09 11:51:59
。 – JSJ 2013-04-09 11:53:58