Override WinForms MessageBox Control

That's it, I understand that for widely customizable dialogs I need to create my own form and ShowDialog() . However, in my case, I just wanted to extend the MessageBox class to make it easier for CustomMessageBox , which is able to display various icons installed in those defined by the system.

I had not redefined such control before, and I'm not even sure where to start. Can someone point me in the right direction?

Thank you for your time.

+4
source share
3 answers

MessageBox actually not a control (not inherited from Control ), it's just a class.

In fact, it’s even almost a static class, since there is no public / protected constructor, and only static methods. This is more like a factory.

You should probably write your own as it is not expandable.

+5
source

You cannot configure MessageBox like this, unfortunately. You will have to collapse yourself.

+2
source

MessageBox does not support customization, other than changing the message, title, and standard buttons that are available. If you want to create your own message box, you must create it yourself. See How to create a custom MessageBox? for example.

+1
source

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


All Articles