public ScrollToVerticalOffset ( double offset ) : void | ||
offset | double | The position that the content scrolls to. |
return | void |
// XAML// C# private void Button_Click(object sender, RoutedEventArgs e) { scrollViewer.ScrollToVerticalOffset(100); }
// XAMLOverall, the ScrollViewer class and its methods are part of the System.Windows.Controls namespace, which is included in the WPF library.// C# private void Button_Click(object sender, RoutedEventArgs e) { double itemHeight = listBox.ItemContainerGenerator.ContainerFromIndex(0).ActualHeight; scrollViewer.ScrollToVerticalOffset(itemHeight * 2); } ...
public ScrollToVerticalOffset ( double offset ) : void | ||
offset | double | The position that the content scrolls to. |
return | void |