M
msw555
I'm encountering strange behavior when modifying the back color of a
button.
Actually when I try to restore the button's original back color I have
the problem. The button does not get back its original back color.
Try the following:
1. Create a new windows forms application.
2. Place a button on the form.
3. In the event handler for the button click write the following code:
this.button1.BackColor = this.button1.BackColor;
4. Run the application and press the button.
5. The color of the button changes, although according to the code you
wrote it should clearly remain the same. At least that's the behavior
I'm getting.
Does anyone have an idea why this happens and / or how to work around
it?
Thanks
button.
Actually when I try to restore the button's original back color I have
the problem. The button does not get back its original back color.
Try the following:
1. Create a new windows forms application.
2. Place a button on the form.
3. In the event handler for the button click write the following code:
this.button1.BackColor = this.button1.BackColor;
4. Run the application and press the button.
5. The color of the button changes, although according to the code you
wrote it should clearly remain the same. At least that's the behavior
I'm getting.
Does anyone have an idea why this happens and / or how to work around
it?
Thanks