WPF button displaying weird blurred colors after mouse over

Snap64 1 Reputation point
2020-08-01T17:50:26.083+00:00

I am just starting out with WPF, and I'm having an issue with the button not displaying properly.

At first I thought it might just be in debug mode, or something I accidentally changed in the project. However, I have created a new project, and the only thing I did was drag a Button from the Toolbox to the display. In addition, I built the release version, and executed the executable directly, and still had the same issue. I also tried making exactly the same project, but using .NET Framework instead of .NET Core, and it seems to be working just fine, so until someone helps me solve this issue I'll just use .NET Framework instead of Core.

In addition, I also tried updating VS to 16.6.5 and am still having the same issue.

What is happening is that the button displays normally at first, but as soon as I move the mouse over and off of it the color gets blurred and weird (see picture). In addition, in my original project I also had some radio buttons, for which the button part wasn't displaying after the mouse moved over it as well, although I suspect this issue has the same cause as the button so I'm concentrating on that for this post. I've also noticed that it reverts to normal after minimizing the window and reopening it, if that will help figure out what's happening.

I'm using Windows 10, and have Visual Studio Community 2019 16.6.5 installed. The project is a WPF .Net Core 3.1.302 C# project.

Here is the XAML code for my project, in MainWindow.xaml, although I haven't actually edited it, just simply dragged a button onto the display:

<Window x:Class="WPFFinalButtonTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WPFFinalButtonTest"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Button Content="Button" HorizontalAlignment="Left" Margin="420,198,0,0" VerticalAlignment="Top"/>

    </Grid>
</Window>

Button displays normal at first
Button displays normal still with mouse over
After mouse out, button color gets weird

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,670 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Aden Earnshaw 11 Reputation points
    2021-08-03T18:57:57.19+00:00

    If anyone is still have issues with this, I followed this Github Issue (https://github.com/dotnet/wpf/issues/707) and the solution that worked for me was to uninstall Sonic Studio (part of Asus ROG suite) completely and restart.

    It's more of a workaround than a fix, but given I don't really use that software, it was a no brainer.

    2 people found this answer helpful.
    0 comments No comments