Solved

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

Posted on 2010-08-25
4
629 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 27

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
vb6 connector to mongodb 2 31
Need help with a query 6 55
Setting runtime form location 4 19
Close word object 13 24
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now