2017-09-15 143 views
0

下圖顯示了我的項目。如何點擊WPF ScrollViewer向下按鈕

My project

這是給你的測試需求XAML代碼。

<Window x:Class="MainWindow" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Title="MainWindow" Height="200" Width="525"> 

<ScrollViewer Name="ScrollViewer1" Height="67" VerticalAlignment="Top"> 
    <StackPanel> 
     <TextBox Name="TextBox1" Text="TextBox1"/> 
     <TextBox Name="TextBox2" Text="TextBox2"/> 
     <TextBox Name="TextBox3" Text="TextBox3"/> 
     <TextBox Name="TextBox4" Text="TextBox4"/> 
     <TextBox Name="TextBox5" Text="TextBox5"/> 
     <TextBox Name="TextBox6" Text="TextBox6"/> 
    </StackPanel> 
</ScrollViewer> 

</Window> 

下圖顯示了我的問題;

Question

那麼,如何點擊爲了去ScrollViwer結束WPF的ScrollViewer向下按鈕?

回答

1

右鍵單擊ScrollViewer->編輯模板 - >編輯副本,查看滾動查看器的模板。 ScrollViewer包含一個ScrollBar。 ScrollBar包含RepeatButton和一個Track。 RepeatButton負責滾動條的上下移動。嘗試檢查它。您可能會發現如何實現您的目標的一些想法。