Solved

Color conversion gone wrong in converting from vb6 to vb.net

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

   I'm porting an application from vb6 to vb.net 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!
0
Comment
Question by:sn1fflez
  • 2
4 Comments
 
LVL 8

Expert Comment

by:SylvainDrapeau
ID: 33527502
Hello !

Could it be "colortranslator" instead of translation ?

Syldra
0
 
LVL 8

Expert Comment

by:SylvainDrapeau
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

Syldra
0
 
LVL 28

Accepted Solution

by:
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
0
 

Author Closing Comment

by:sn1fflez
ID: 33541623
Thanks for the Help!
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…
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…

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