Solved

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

Posted on 2011-02-13
2
1,164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans

630 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