Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to change WinForm controls' text color programatically?

Status
Not open for further replies.

thedougster

Programmer
Jan 22, 2009
56
US
Can anybody tell me how to change WinForm controls' text color programatically? I have no problem finding the fields to assign colors to, but the compiler doesn't recognize any color I mention, whether it's something like WindowText, or something like Red.

BTW, I'm using VC# Express 2008.
 
Can you post your code how you do it?

Normally, it's just doing control.ForeColor = SystemColors.WindowText
 
example of textbox:
Code:
textBox1.ForeColor = Color.Red;
Simple as that if that is what you're aiming for.

Note: for standard colours like Red, you need to prefix them with "Color."

Regards,

Martin

Computing Design And Services:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top