colour in integer and color.xx form

PedroA

Active member
Joined
Oct 14, 2013
Messages
26
Programming Experience
Beginner
Hi,

I need to make the backcolor of labels and buttons based on values stored in a MS Access database.

The problem is that there are colour values based on the vb6 integer style and the vb.net style based on color.xx from the colour picker (stored in the database using ToArgb and retrieved using FromArgb), in the database. The VB.net program has taken over the old vb6 version.

Is there a way to differentiate the colour types or make them have a consistent base to work with all items?

Thanks
 
If you just have a number in the database that could be interpreted in two different ways and both would create a valid result then no, there is no way to distinguish which it is. A number is a number. Is there any other data that could be used, e.g. a record creation date? I'm not familiar with how VB6 uses integers to represent colours. How does it work? The mechanism may provide a means to at least make a best guess, e.g. the most-significant byte will represent the alpha channel for the .NET-generated values so it will likely be zero in all cases. If the VB6-generated values put greater than zero in that position then that could be used as a discriminator.
 
Back
Top