Override WinForms MessageBox Control

c#, dialog, overriding, winforms

Solution

`MessageBox` is not a control actually (doesn't inherit from `Control`), it's just a class.

Actually, it's even almost a `static` class, as there is no public/protected constructor defined, and only `static` methods. It's more like a factory.

You probably should write your own, as it's not extendable.

Problem

All, I understand that for extensively customised dialogs I would need to create my own form and `ShowDialog()`. However, in my current case I would just like to extend the MessageBox class to facilitate a `CustomMessageBox` that is capable of showing different icons insted of those determined by the system. I have not overridden such a control before and I am not even sure where to start. Could someone point me in the right direction? Thanks for your time.

Original source

Related problems