C# – Why are the disabled buttons changing color

c++winforms

My problem is: When my application is opened, I disable all buttons (in form_Load) and their color changes to the color of the background. But then I do some action (like clicking on a button), and in this action I disable the buttons again.

Now some of these buttons become GRAY and others become as the background.

Why is this? I don't want the the gray effect. Normally when I disable the button at the beginning of the application, it becomes the color I expect, but when I try to disable them again this strange behavior appeared. What to do?

My code is like:

private void _btnDownload2PC_Click(object sender, EventArgs e)
{
    // do action 
    _btnDownloadToPC.Enabled=false; // its color became gray
    _btnDownloadToPhone.Enabled=false; // its color became like the 
                                       // background color and it can't 
                                       // be pressed 
} 

I figured out that the problem is when I use the button_MouseLeave() or button_MouseMove() functions. For example:

private void _btnOneToCort_MouseLeave(object sender, EventArgs e)
{
    this._btnOneToCart.Image=global::MyProject.Properties.Resources.button3over;
}

but this doesn't make sense. Why does this function change my button settings (I don't know what these are) When I use these function this strange behavior appears, but when I don't, everything goes right?

Best Solution

Why don't disable buttons in designer? If not acceptable, do that in form constructor not Form_Load.

Also, how can you click on button if it's disabled?

Are form color settings default? Have you changed windows theme color preferences?