我有一些消息框,我这样的代码: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