Color conversion gone wrong in converting from vb6 to

Posted on 2010-08-25
Last Modified: 2012-05-10
Hello Everyone,

   I'm porting an application from vb6 to and the colors I use are wrong. For example in a picturebox I would display the color red in vb6 but now it shows a different color. I think maybe there is a problem with using the following line of code:
system.drawing.colortranslation.fromole (selectedcolor) 

Open in new window

Any help would be appreciated!
Question by:sn1fflez
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

Expert Comment

ID: 33527502
Hello !

Could it be "colortranslator" instead of translation ?


Expert Comment

ID: 33527541
What is the formaat of "selectedcolor" ?

It is supposed to be a color in the form of an integer (HTML style).

Ex. : Red would be &HFF0000 and Green would be &HFF00

LVL 28

Accepted Solution

Ark earned 500 total points
ID: 33540257
For 'normal' colors your can use Color.FromARGB or ColorTranslator.FromWin32. Use FromOle when in VB6 you used 'system' colors - vbButtonFace, vbWindowsText etc

Author Closing Comment

ID: 33541623
Thanks for the Help!

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

737 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