Aidan Posted February 11, 2005 Posted February 11, 2005 Does anyone know how to change the colour of a msgbox? Aidan. Quote
stustarz Posted February 11, 2005 Posted February 11, 2005 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 Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
Dill Posted February 18, 2005 Posted February 18, 2005 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 Quote
Leaders Iceplug Posted February 18, 2005 Leaders Posted February 18, 2005 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. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
thenerd Posted February 19, 2005 Posted February 19, 2005 Make your own messagebox class that allows you to change the color. It will be useful for when you will ( YOU WILL! ) want to change those things in the future. Quote
Administrators PlausiblyDamp Posted February 19, 2005 Administrators Posted February 19, 2005 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
IngisKahn Posted February 19, 2005 Posted February 19, 2005 Of course MessageBox doesn't derive from Form. Message boxes come from a standard API call built into windows. Quote "Who is John Galt?"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.