Click here to Skip to main content
15,885,878 members
Articles / Mobile Apps / Windows Mobile
Alternative
Tip/Trick

Converting HTML Color Code to System.Drawing.Color(WinMobile application)

Rate me:
Please Sign up or sign in to vote.
4.88/5 (5 votes)
6 Nov 2011CPOL 35.4K   1   4
Here is a simple method:System.Drawing.Color mycol = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");or:System.Drawing.Color mycol = System.Drawing.ColorTranslator.FromHtml("White");Further ReadingColorTranslator.FromHtml Method @ MSDN[^]
Here is a simple method:
C#
System.Drawing.Color mycol = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");

or:
C#
System.Drawing.Color mycol = System.Drawing.ColorTranslator.FromHtml("White");

Further Reading


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
Ajith_joseph14-Nov-12 19:58
Ajith_joseph14-Nov-12 19:58 
GeneralThanks Richard and ThatRaja for your comments. That is also ... Pin
Midhunlal G22-Jan-12 17:41
Midhunlal G22-Jan-12 17:41 
GeneralThis works great if you're absolutely sure the input string ... Pin
Richard Deeming8-Nov-11 8:03
mveRichard Deeming8-Nov-11 8:03 
GeneralRe: Agree, I didn't handle those things(Because its just a Tip/T... Pin
thatraja16-Nov-11 1:44
professionalthatraja16-Nov-11 1:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.