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

Developer technologies | Windows Presentation Foundation
Developer technologies | XAML
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.