ListBox.ScrollIntoView(Object) 메서드

정의

개체를 스크롤하여 표시되도록 합니다.

public:
 void ScrollIntoView(System::Object ^ item);
public void ScrollIntoView (object item);
member this.ScrollIntoView : obj -> unit
Public Sub ScrollIntoView (item As Object)

매개 변수

item
Object

스크롤할 개체입니다.

예제

다음 예제에서는 사용 하는 방법의 ScrollIntoView 뷰포트를 목록 상자에서 항목 스크롤 하는 방법입니다.

private void ScrollIntoView(object sender, RoutedEventArgs e)
{
    var index = cbScrollIntoView.SelectedIndex;
    var item = lbScrollIntoView.Items.GetItemAt(index);
    lbScrollIntoView.ScrollIntoView(item);
}
Private Sub ScrollIntoView(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim index = cbScrollIntoView.SelectedIndex
    Dim item = lbScrollIntoView.Items.GetItemAt(index)
    lbScrollIntoView.ScrollIntoView(item)
End Sub

설명

개체를 표시 하지 뷰포트 맨 위나 맨 아래에 맞춥니다.

적용 대상