简体   繁体   中英

How to display ok button at bottom in .net compact framework?

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?

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.

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM