Msgbox Colour??

Just create your own using a form. A messagebox is a standard dialog and shows the colours based on the colour scheme of the PC it is shown on - as far as i know, but whenever i want to customise the messagebox i just create a form modify it to my needs and show that with a message.

If you need an example give me a shout
 
You could even inherit the messagebox to keep all the functionality. override the onpaint to include your own color.

I dont have .net in front of me right now so this is just untested theory but it should work.

Dill
 
Actually, if you try to Inherit the messagebox, you'll get a warning stating that you'll have to add a constructor since the only constructor for the messagebox class is Private (thus beginning the metaproblem) - when you create a constructor, you must immediately call the base class constructor, but (obviously) you can't call the base class constructor, because it is private. :(
And I think the MessageBox.Show is just a dummy class that actually creates a new form from scratch and shows it - it's not an actual form. It doesn't even inherit form.
:)
 
Just out of interest why would you want to change the colour of the MessageBox? If a user has chosen a colour scheme from windows control panel then your message box should follow that; otherwise you could end up with severe colour clashes, hard to read displays and would also be causing problems for the visual impaired who happen to have selected a high contrast scheme.
 
Back
Top