Live Chat Icon For mobile
Live Chat Icon

How to convert Color to it’s corresponding Hexadecimal value

Platform: ASP.NET| Category: Miscellaneous


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
	’Put user code to initialize the page here
End Sub

Function ToHexColor(ByVal c As Color) As String
	Return '#' + c.ToArgb().ToString('x').Substring(2)
End Function


private void Page_Load(object sender, System.EventArgs e)
	// Put user code to initialize the page here
string ToHexColor(Color c   ) 
	return '#' + c.ToArgb().ToString('x').Substring(2);

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.