Skip to content

The BackColor & MouseOverBackColor property of Button doesn't work #3770

@Amy-Li03

Description

@Amy-Li03
  • .NET Core Version:
    .Net SDK 6.0.100-alpha.1.20421.6

  • Have you experienced this same bug with .NET Framework?:
    No

  • More info:
    This is a regression issue, it cannot reproduce on .Net SDK 5.0.100-preview.8.20417.9

Problem description:
The BackColor of Button doesn't work when Button's FlatStyle is Flat or Popup .
The MouseOverBackColor of Button doesn't work when Button's FlatStyle is Flat.
Actual

Expected behavior:
After run the project, the Button's BackColor should be YellowGreen;
When mouse over on the button, Button's BackColor should be Firebrick.
Expected

Minimal repro: DemoApp.zip

  1. Create a new winforms .NET core project and target to .NET 5.0.
  2. Add a Button to the form designer.
  3. Add the following code to the structure method of Form1.
    button1.FlatStyle = FlatStyle.Flat;
    button1.BackColor = Color.YellowGreen;
    button1.FlatAppearance.MouseOverBackColor = Color.Firebrick;
  4. Build and run the project.
  5. Observe the BackColor of Button, then mouse over on the button and observe the BackColor of Button.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions