如何在.net紧凑框架底部显示确定按钮?

发布于 2024-09-25 12:26:13 字数 300 浏览 1 评论 0原文

我正在用 C# 开发移动应用程序。我在应用程序中使用以下代码来显示消息框,但“确定”按钮显示在右上角。我想在底部显示确定按钮。这是我的代码

MessageBox.Show("Records successfully inserted","Customer Entry",MessageBoxButtons.OK,MessageBoxIcon.None,MessageBoxDefaultButton.Button1);

我的代码有什么问题吗?或者我应该需要做不同的事情?您能给我提供任何可以解决上述问题的代码或链接吗?

I am developing mobile application in C#. I am using the following code in my application to display the messagebox but the button ok is displayed at the top right corner. I want to display the ok button at the bottom. This is my code

MessageBox.Show("Records successfully inserted","Customer Entry",MessageBoxButtons.OK,MessageBoxIcon.None,MessageBoxDefaultButton.Button1);

Is anything wrong in my code? or should I need to do different things ? Can you please provide me any code or link through which I can resolve the above issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

海拔太高太耀眼 2024-10-02 12:26:13

这是紧凑框架中标准的 MessageBox 行为,在右上角显示“确定”按钮(我认为,除非您使用的是 Windows Mobile 6.5.x,否则它将显示在底部)。

我能看到“移动”底部的“确定”按钮的唯一方法是创建一个表单并使用它而不是 MessageBox。这意味着创建一种自定义 MessageBox 类。

It is the standard MessageBox behaviour in the compact framework to display the OK button at the top right corner (unless, I think, you are on a Windows Mobile 6.5.x, in that case it would be displayed at the bottom).

The only way I can see of "moving" that OK button at the bottom would be to create a form and use it instead of the MessageBox. That means creating a kind of custom MessageBox class.

只涨不跌 2024-10-02 12:26:13

我同意这很烦人。特别是在小型触摸屏上工作时,很难按右上角的“确定”。

由于您只想显示“确定”按钮 ID,建议使用 MessageBox.OKCancel 代替,并将任何按钮按下视为“确定”。设置除“确定”之外的任何内容都会在底部显示按钮。

MessageBox.Show("Records successfully inserted","Customer Entry",MessageBoxButtons.OKCancel,MessageBoxIcon.None,MessageBoxDefaultButton.Button1);

This is quite annoying i agree. Especially when working on small touchscreens where pressing the OK in the top right is difficult.

Since you just want to present the OK button id suggest using MessageBox.OKCancel instead and just treat any button press as OK. Setting anything other than OK will show the buttons at the bottom.

MessageBox.Show("Records successfully inserted","Customer Entry",MessageBoxButtons.OKCancel,MessageBoxIcon.None,MessageBoxDefaultButton.Button1);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文