SIMIN Posted September 24, 2008 Posted September 24, 2008 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. Quote
Nate Bross Posted September 25, 2008 Posted September 25, 2008 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) Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Leaders snarfblam Posted September 25, 2008 Leaders Posted September 25, 2008 (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 September 25, 2008 by snarfblam Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.