Using Hex Codes for Colors in System.Drawing

All the methods of System.Drawing.Color, at first, seem to bypass the use of Hex codes, like normally used in HTML. However, there is a method using one argument that you can use:

Color.FromARGB

If you use only one Int32 as an argument, you can preface your Hex code with ‘&H78′ and it will work perfectly – - like this:

myVar=Color.FromARGB(&H78CEEFFF)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>