System.Drawing.Color

There are several different approaches you can use when working with colours.


All the windows form controls expose ForeColor and a BackColor properties.
These can be easily manipulated at run time using the System.Drawing.Color class

txtTextBox1.BackColor = System.Drawing.Color.Orange 

You can also provide a specific colour if you want a different colour

txtTextBox1.BackColor = System.Drawing.Color.FromArgb(50,10,40) 

You can also obtain a drawing colour from the actual Integer colour value.

txtTextBox1.BackColor = System.Drawing.Color.FromArgb(1625646) 


txtTextBox1.BackColor = System.Drawing.Color.FromName("Window") 



RGB Integer

You may also come across colour properties that take an integer value:

objLineShape.Line.BackColor.RGB = Microsoft.VisualBasic.RGB(50,10,40) 


AliceBlue  
AntiqueWhite  
Aqua  
Aquamarine  
Azure  
B  
Beige  
Bisque  
Black  
BlanchedAlmond  
Blue  
BlueViolet  
Brown  
BurlyWood  
CadetBlue  
Chartreuse  
Chocolate  
Coral  
CornflowerBlue  
Cornsilk  
Crimson  
Cyan  
DarkBlue  
DarkCyan  
DarkGoldenrod  
DarkGray  
DarkGreen  
DarkKhaki  
DarkMagenta  
DarkOliveGreen  
DarkOrange  
DarkOrchid  
DarkRed  
DarkSalmon  
DarkSeaGreen  
DarkSlateBlue  
DarkSlateGray  
DarkTurquoise  
DarkViolet  
DeepPink  
DeepSkyBlue  
DimGray  
DodgerBlue  
Firebrick  
FloralWhite  
ForestGreen  
Fuchsia  
G  
Gainsboro  
GhostWhite  
Gold  
Goldenrod  
Gray  
Green  
GreenYellow  
Honeydew  
HotPink  
IndianRed  
Indigo  
Ivory  
Khaki  
Lavender  
LavenderBlush  
LawnGreen  
LemonChiffon  
LightBlue  
LightCoral  
LightCyan  
LightGoldenrodYellow  
LightGray  
LightGreen  
LightPink  
LightSalmon  
LightSeaGreen  
LightSkyBlue  
LightSlateGray  
LightSteelBlue  
LightYellow  
Lime  
LimeGreen  
Linen  
Magenta  
Maroon  
MediumAquamarine  
MediumBlue  
MediumOrchid  
MediumPurple  
MediumSeaGreen  
MediumSlateBlue  
MediumSpringGreen  
MediumTurquoise  
MediumVioletRed  
MidnightBlue  
MintCream  
MistyRose  
Moccasin  
NavajoWhite  
Navy  
OldLace  
Olive  
OliveDrab  
Orange  
OrangeRed  
Orchid  
PaleGoldenrod  
PaleGreen  
PaleTurquoise  
PaleVioletRed  
PapayaWhip  
PeachPuff  
Peru  
Pink  
Plum  
PowderBlue  
Purple  
R  
Red  
RosyBrown  
RoyalBlue  
SaddleBrown  
Salmon  
SandyBrown  
SeaGreen  
SeaShell  
Sienna  
Silver  
SkyBlue  
SlateBlue  
SlateGray  
Snow  
SpringGreen  
SteelBlue  
Tan  
Teal  
Thistle  
Tomato  
Transparent  
Turquoise  
Violet  
Wheat  
White  
WhiteSmoke  
Yellow  
YellowGreen  

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext