It took a little searching to find out how to set the
BackColor or
ForeColor property of a control to the predefined colors you gets in the Visual Studio Properties window for BackColor's popup color setting on the System tab. For example, I want to set to the BackColor to the "Control" color.
control.BackColor = Color.FromKnownColor(KnownColor.Control)
I found this on:
http://bytes.com/forum/thread654472.html
Excellent thanks
ReplyDeleteIn addition to setting the BackColor back to SystemColors.Control, I found that I also had to set UseVisualStyleBackColor to True to have the button again look as it did by default.
ReplyDeleteBeen looking for this.
ReplyDeleteThanks for the info!
Thanks,
ReplyDeleteIt was helpful
saved me lots of time...thanks a lot
ReplyDeleteThis is great for controls like a Button or CheckBox, but controls like a TextBox or ComboBox will need Color.FromKnownColor(KnownColor.Window) (or SystemColors.Window)
ReplyDeleteIt is better to set the BackColor to Color.Empty or simply use control.ResetBackColor()
Thank you very much.
ReplyDeleteThanks a lot friend
ReplyDeleteThanks a lot, my friend
ReplyDeleteThanks. My first hit on that one and got your answer right away!
ReplyDeleteTry SystemColors.Window which does the same as shorter Term
Thanks!
ReplyDeleteThank you!
ReplyDeleteStill thanking!
ReplyDeleteAnd 8 years later, the thanks are still coming in! :)
ReplyDelete