다음을 통해 공유


BindingManagerBase.Position 속성

정의

파생 클래스에서 재정의되는 경우 이 데이터 원본 지점에 바인딩된 컨트롤을 제어하는 내부 목록의 위치를 가져오거나 설정합니다.

public:
 abstract property int Position { int get(); void set(int value); };
public abstract int Position { get; set; }
member this.Position : int with get, set
Public MustOverride Property Position As Integer

속성 값

기본 목록의 위치를 지정하는 인덱스(0부터 시작하는 인덱스)입니다.

예제

다음 코드 예제에서는 속성을 설정 하는 네 가지 메서드를 보여 줍니다 Position . 이 메서드는 MoveNext 속성을 1씩 증분합니다. 이 메서드는 MovePrevious 속성을 1로 줄입니다. 메서드는 MoveFirst 속성을 0으로 설정하고 메서드는 MoveLast 속성을 속성 값에서 1을 뺀 값 Count 으로 설정합니다.

private:
   void BindingManagerBase_CurrentChanged( Object^ sender, EventArgs^ /*e*/ )
   {
      // Print the new value of the current object.
      Console::Write( "Current Changed: " );
      Console::WriteLine( ( (BindingManagerBase^)(sender) )->Current );
   }

   void MoveNext()
   {
      // Increment the Position property value by one.
      myBindingManagerBase->Position = myBindingManagerBase->Position + 1;
   }

   void MovePrevious()
   {
      // Decrement the Position property value by one.
      myBindingManagerBase->Position = myBindingManagerBase->Position - 1;
   }

   void MoveFirst()
   {
      // Go to the first item in the list.
      myBindingManagerBase->Position = 0;
   }

   void MoveLast()
   {
      // Go to the last row in the list.
      myBindingManagerBase->Position = myBindingManagerBase->Count - 1;
   }
private void BindingManagerBase_CurrentChanged
(object sender, EventArgs e)
{
   // Print the new value of the current object.
   Console.Write("Current Changed: ");
   Console.WriteLine(((BindingManagerBase)sender).Current);
}

private void MoveNext()
{
   // Increment the Position property value by one.
   myBindingManagerBase.Position += 1;
}

private void MovePrevious()
{
   // Decrement the Position property value by one.
   myBindingManagerBase.Position -= 1;
}

private void MoveFirst()
{
   // Go to the first item in the list.
   myBindingManagerBase.Position = 0;
}

private void MoveLast()
{
   // Go to the last row in the list.
   myBindingManagerBase.Position = 
   myBindingManagerBase.Count - 1;
}
Private Sub BindingManagerBase_CurrentChanged(sender As Object, e As EventArgs)
    ' Print the new value of the current object.
    Console.Write("Current Changed: ")
    Console.WriteLine(CType(sender, BindingManagerBase).Current)
End Sub


Private Sub MoveNext()
    ' Increment the Position property value by one.
    myBindingManagerBase.Position += 1
End Sub


Private Sub MovePrevious()
    ' Decrement the Position property value by one.
    myBindingManagerBase.Position -= 1
End Sub


Private Sub MoveFirst()
    ' Go to the first item in the list.
    myBindingManagerBase.Position = 0
End Sub


Private Sub MoveLast()
    ' Go to the last row in the list.
    myBindingManagerBase.Position = myBindingManagerBase.Count - 1
End Sub

설명

속성을 사용하여 .에 Position 의해 BindingManagerBase유지 관리되는 기본 목록을 반복합니다. 첫 번째 항목으로 이동하려면 0으로 Position 설정합니다. 목록의 끝으로 이동하려면 속성 값에서 1을 뺀 값 Count 으로 설정합니다Position.

PositionChanged 이벤트는 속성 값이 변경되면 Position 발생합니다.

적용 대상

추가 정보