?
Solved

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

Posted on 2010-08-25
4
Medium Priority
?
637 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
[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
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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 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