The Background color painted on the Button occurs on scrolling slowly using horizontal scrollbar

Arunthivakar Azhagu 1 Reputation point
2021-05-17T14:25:05.47+00:00

Replication:

  1. Make sure the horizontal scrollbar is positioned to the far left
  2. Move the horizontal scroll bar very slowly
  3. Observe the Background color painted on the Button.

Expected result: Background color should not paint on the Button.

Sample Code:

<Window  
    x:Class="Button.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:local="clr-namespace:Button"  
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
    Title="MainWindow"  
    Width="170"  
    Height="200"  
    mc:Ignorable="d">  
    <ScrollViewer HorizontalScrollBarVisibility="Visible">  
        <Grid Width="250" Background="Red">  
            <Button  
                Width="250"  
                Height="30"  
                Margin="20,5,5,5"  
                Background="White"  
                BorderBrush="White"  
                Content="GroupBarItem 1"  
                SnapsToDevicePixels="True" />  
        </Grid>  
    </ScrollViewer>  
</Window>  
  

Output:

97129-sshot-39.png

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,710 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
789 questions
{count} votes