TextBox color
-
How to initilize a textBox with background color that you want. I tried this "textBox25.BackColor=Color.Green;" but the dropdown has predefine colors (e.g Red, Green, Gray...) I want to use my own custom color.
Use Color.FromArgb method for using ur own custom color. For example: textBox25.BackColor = Color.FromArgb(255, 133 , 144); //You need to know RGB values for your custom color You can see Color.FromArgb in MSDN for more on this.
-
How to initilize a textBox with background color that you want. I tried this "textBox25.BackColor=Color.Green;" but the dropdown has predefine colors (e.g Red, Green, Gray...) I want to use my own custom color.
You can set the background color, provided you know the values of the different color elements. The following code sets the background to Yellow: textBox25.BackColor = Color.FromArgb( 255,255,0 ); Color.FromArgb() can be used to set a color with different attributes. Check out the different calling options. Bob