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] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

726 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