I was experimenting with different options for the button background color and ended up changing the BackColor
property in the Appearance category. I then chang
Referring to your question title, "How to reset to default button BackColor?" , I solved my problem by:
Create another button, say ButtonFoo
, and set it to invisible,
ButtonFoo.visible = False
and you can use this button to get its color (since it is a default color) to reset your another button color, for example,
ButtonChangedColor.BackColor = ButtonFoo.BackColor
There you go; color is restored to its default :)
Button1.BackColor = Color.FromKnownColor(KnownColor.Control)
Use the FromKnowColor
to access the system colors.
It is really that simple.
What worked for me:
CommandButton1.BackColor = vbButtonFace
In Winforms the default color is Control. You can set it from the Properties Pane in VS.
PropertyName is BackColor and the color you want is in System Colors -> Control
To restore the default background and foreground to a button use:
Button1.BackColor = SystemColors.ButtonFace;
Button1.ForeColor = default(Color);
Button1.UseVisualStyleBackColor = true;