Solved

VB.NET 2010 Convert String to System.Drawing.Color

Posted on 2011-02-13
2
1,121 Views
Last Modified: 2012-05-11
Probably a simple one, but I'm not sure where to find it. Normally it's easy if the name of the string was called 'black', 'white', etc. But I'm using RGB values now, aka like FFFFFF = white 000000 = black to adjust things. Reason being is it will be configurable in a INI file so it is a string that has 'FFFFFF' for example.

How can I convert this to System.Drawing.Color, in for example, a .backcolor of a picturebox?
0
Comment
Question by:Valleriani
2 Comments
 
LVL 16

Accepted Solution

by:
Swapnil Piparia earned 500 total points
ID: 34881715
Hi Valleriani,

    You can do it by,
     
       
.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFFF")

Open in new window

Thanks,
netswap
0
 
LVL 7

Author Closing Comment

by:Valleriani
ID: 34881716
Oh wow, I completely missed this one. THanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A short article about problems I had with the new location API and permissions in Marshmallow
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now