question

ArunthivakarAzhagu-7581 avatar image
0 Votes"
ArunthivakarAzhagu-7581 asked DaisyTian-1203 commented

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

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-wpfdotnet-wpf-xaml
sshot-39.png (65.6 KiB)
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ArunthivakarAzhagu-7581
I used your code to test, but I can't reproduce your error. The button doesn't change when I scrolling slowly using horizontal scrollbar. What is your project target platform? .Net core or .Netframework?

0 Votes 0 ·

@DaisyTian-MSFT

I have reproduced this issue in .NET Framework 4.6 and Microsoft Visual Studio Professional 2019 & Version 16.4.0

0 Votes 0 ·
DaisyTian-1203 avatar image DaisyTian-1203 ArunthivakarAzhagu-7581 ·

@ArunthivakarAzhagu-7581
Could you use the latest version of Visual Studio 2019 16.9.4 to check if this issue exists or not? Does this still exist after you stop dragging the scrollbar?

0 Votes 0 ·

@DaisyTian-MSFT
Okay, I'll check with the latest version. Yes, this bug still exists after stop dragging the scrollbar.

0 Votes 0 ·

@DaisyTian-MSFT
I have checked with the .NET Framework 4.6 - Microsoft Visual Studio Professional 2019 & Version 16.9.6 but the same bug reproduced when scrolling slowly using a horizontal scrollbar.

0 Votes 0 ·
Show more comments

0 Answers