I need to redesign old windows forms application. So I decided to create a custom button control.
Let's say I defined a background color to be red for that custom button. When I do this:
- place that button on the form
- edit property of any other control
- save the project
Visual Studio will automatically update the designer file and append:
this.btnCustom.BackColor = System.Drawing.Color.Red;
I don't want this to happen. This should be coded only in CustomButton class, not in the designer file. This will be the big problem if I decide to change button color to blue. Then, instead changing color only in CustomButton class, I would have to change color manually for each button. Is there any way to prevent this?