BindingManagerBase.Position BindingManagerBase.Position BindingManagerBase.Position BindingManagerBase.Position Property

정의

파생 클래스에서 재정의되면, 이 데이터 소스에 바인딩된 컨트롤이 가리키는 내부 목록에서의 위치를 가져오거나 설정합니다.When overridden in a derived class, gets or sets the position in the underlying list that controls bound to this data source point to.

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부터 시작)입니다.A zero-based index that specifies a position in the underlying list.

예제

다음 코드는 설정 하는 예제에서는 네 가지 메서드는 Position 속성입니다.The following code example shows four methods that set the Position property. MoveNext 메서드 속성을 1 씩 증가 합니다.The MoveNext method increments the property by 1. MovePrevious 메서드 감소 1만 속성입니다.The MovePrevious method decrements the property by 1. MoveFirst 메서드는 속성을 0으로 설정 하며 MoveLast 속성의 값을 설정 하는 메서드는 Count 에서 1 뺀 속성이.The MoveFirst method sets the property to 0, and the MoveLast method sets the property to the value of the Count property minus 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 );
   }

   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 'BindingManagerBase_CurrentChanged


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


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


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


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

설명

사용 하 여는 Position 속성에서 관리 하는 기본 목록에서 반복 하는 BindingManagerBase합니다.Use the Position property to iterate through the underlying list maintained by the BindingManagerBase. 첫 번째 항목으로 이동 하려면 설정의 Position 0입니다.To go to the first item, set the Position to 0. 목록의 끝으로 설정 합니다 Position 값를 Count 에서 1 뺀 속성이.To go to the end of the list, set the Position to the value of the Count property minus 1.

합니다 PositionChanged 이벤트가 발생할 때를 Position 속성 값이 변경 합니다.The PositionChanged event occurs when the Position property value changes.

적용 대상

추가 정보