Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this question: How do i convert RGB color to Hexadecimal in VB.net?
Posted

1 solution

Pretty simple:
VB
Dim c As Color = Color.RoyalBlue
Dim value As Integer = c.ToArgb()
Dim hex As String = value.ToString("X6")
 
Share this answer
 
Comments
OriginalGriff 22-Jul-14 10:53am    
Um. That's even easier?
The integer value = R * 65536 + G * 256 + B
Then if you want hex, you just do the string conversion as above.
Or are we talking at cross purposes?
Member 14058955 21-Nov-18 4:25am    
&HFF00&
OriginalGriff 22-Jul-14 11:11am    
You are kidding, right?
You can't write down a simple assignment yourself?
CleverCoder1222 22-Jul-14 11:20am    
Sorry i'm a newbie :(
OriginalGriff 22-Jul-14 11:27am    
So you can;t do it yourself?
Clue: it starts
Dim value As Integer =
And continues really, really easily! :laugh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900