我有一個ScrollViewer應用程序。 2個滾動條相遇的地方是一個令人討厭的小方塊(見下面的img),我試圖擺脫。當我「窺探」應用程序時,我可以將其視爲「矩形」,但我認爲它是ScrollViewer的一部分?令人討厭的廣場滾動條滿足
我已經搜索和搜索有這方面的信息,但所有我能看到的是建議通過放置東西在它的頂部,以隱藏它:■
任何人都可以點我在正確的方向進行排序呢?
<ControlTemplate x:Key="HorizontalScrollBar"
TargetType="{x:Type ScrollBar}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="18"/>
<ColumnDefinition Width="0.00001*"/>
<ColumnDefinition MaxWidth="18"/>
</Grid.ColumnDefinitions>
<Border
Grid.ColumnSpan="3"
CornerRadius="2"
Background="Transparent" />
<RepeatButton
Grid.Column="0"
Style="{StaticResource ScrollBarLineButton}"
Width="18"
Command="ScrollBar.LineLeftCommand"
Content="M 4 0 L 4 8 L 0 4 Z" />
<Track
Name="PART_Track"
Grid.Column="1"
IsDirectionReversed="False">
<Track.DecreaseRepeatButton>
<RepeatButton
Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageLeftCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb
Style="{StaticResource ScrollBarThumb}"
Margin="0,1,0,1"
Background="{DynamicResource NormalBrush}"
BorderBrush="{DynamicResource NormalBorderBrush}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton
Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageRightCommand" />
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton
Grid.Column="3"
Style="{StaticResource ScrollBarLineButton}"
Width="18"
Command="ScrollBar.LineRightCommand"
Content="M 0 0 L 4 4 L 0 8 Z"/>
</Grid>
</ControlTemplate>
你是如何讓滾動條變成彩色的? – Paparazzi
我絕不是WPF的專家,我不能說我完全理解了一切,但據我所見,它來自此控件模板 – Fred
可能不是什麼打破它,但Grid.Column =「3」超出範圍。 – Paparazzi