Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

Colors are different in VB.NET and VB6.

For example, the background of my form in my VB.NET program is "194, 217, 247" but I cannot use this format for my VB6 application.

So how can I convert "194, 217, 247" to a format which VB6 accepts?

Thanks.

Posted

IN .NET your 194, 217, 247 = R, G, B

 

' thus
' R = 194
' G = 217
' B = 247

'Visual Basic stores this as a Long (integer)
' this calculation should work
Color = (256 * 256 * B)   + G * 256 + R 

'or the bult-in VB function RGB can calculate the Long value for you 
Color = RGB (R,G,B)

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

  • Leaders
Posted (edited)
Color.ToARGB() should return a 32-bit integer composite value that would be the VB6 equivalent, although the alpha component may have to be filtered out. Edited by snarfblam
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...