-1

I'm wondering if anyone has found a way for the MessageBox.Show() method to return anything other than the enum values passed to it.

It would be handy to have a way to detect alternate keystrokes. For example, F10 key, even though Show() does not display it.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
Gary Huckabone
  • 402
  • 3
  • 10
  • Yeah, the standard method is this: If you want custom messagebox behavior make your own form. – Daniel Sep 15 '14 at 14:26
  • What MessageBox does got frozen in concrete 30 years ago. Whatever you are looking for is *not* MessageBox, just make your own dialog. – Hans Passant Sep 15 '14 at 17:09

1 Answers1

0

There is no built-in way for .NET with a simple API as MessageBox.

However, there are alternatives to MessageBox, e.g. CommandLink [Stack Overflow] dialogs, which provide much better usability in many cases (if used right). You may also find such functionality in (commercial) 3rd party libraries.

If you can't find anything suitable online, just implement your own Form or UserControl. It's not that hard... If you like to handle custom key presses, that's probably what you need to do.

Community
  • 1
  • 1
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222