i have multiple buttons in my windows form application , and i want to apply some style on btnhover like this
private void button1_MouseEnter(object sender, EventArgs e) {
button1.UseVisualStyleBackColor = false;
button1.BackColor = Color.GhostWhite;
}
private void button1_MouseLeave(object sender, EventArgs e) {
button1.UseVisualStyleBackColor = true;
}
i want to put this style at one place and i want that it atuomatically apply on all buttons in my form . how can i do this , Please help me and thanks in advance
If you really want to put this in one place and have auto-styled forms, that would be its own class:
Then inherit from this class instead of
Form.