Solved

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

Posted on 2011-02-13
2
1,148 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

821 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