• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

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

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
sn1fflez
Asked:
sn1fflez
  • 2
1 Solution
 
SylvainDrapeauCommented:
Hello !

Could it be "colortranslator" instead of translation ?

Syldra
0
 
SylvainDrapeauCommented:
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
 
ArkCommented:
For 'normal' colors your can use Color.FromARGB or ColorTranslator.FromWin32. Use FromOle when in VB6 you used 'system' colors - vbButtonFace, vbWindowsText etc
0
 
sn1fflezAuthor Commented:
Thanks for the Help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now