C #: Is there a winforms way to make C # MessageBox (YesNo) buttons bigger?

It would be nice to have larger MessageBox buttons, as the goal for this application is a tablet.

DialogResult dialogResult = MessageBox.Show( message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); switch (dialogResult) { case DialogResult.Yes: // ... 
+4
source share
7 answers

This is a system setting. Tablet PCs, as a rule, are already set up so that they can easily switch with such buttons so that they work well in any program, and not just for you. To configure the tablet, in Win7 use the control panel + display, personalization, window color. Click "Advanced appearance options", select "Message Box" in the "Component" field. Increase the font size. Do not be fooled by a poor preview, the button will actually grow. This dialog box has additional settings that you can configure to simplify user interface management.

+7
source

A mailbox is just a modal form. You can do it yourself and use ShowDialog()

+4
source

I'm not sure if this is possible or not, but you can use a simple form instead of a dialog box, then you can get the design exactly the way you want.

+2
source

Winforms? Do you mean "automatic change of ownership"? If so, then I do not know.

You can expand your own dialog / form, which is larger, and use it instead. Although it is not as automated as a single line of MessageBox.Show (), it is not very complicated.

+2
source

This is not possible with a MessageBox that wraps its own system dialog.

You will need to create your own dialogue, or even better to find out if there is a way to configure the system to give your applications (and everyone else) big buttons.

The disadvantage of your own role is that you lose all the functionality that your own provides.

+2
source

Yes, along with what MattP said, you need to create a custom form and then use the ShowDialog () method to display the second form as a modal dialog.

 private void button2_Click(object sender, System.EventArgs e) { using (Form2 xForm = new Form2()) { if (xForm.ShowDialog(this) == DialogResult.OK) { // Take some action } } } 
+1
source

You can make the 2nd form, then you can make the buttons as large as possible

+1
source

Source: https://habr.com/ru/post/1342655/


All Articles