System.Drawing.Color


Using the "const" keyword will not work because this is a structure

public static System.Drawing.Color MYCOLOR = new System.Drawing,Color.FromArgb(10,10,10); 


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") 



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