BindingManagerBase.Position Property

Definition

파생 클래스에서 재정의되면, 이 데이터 소스에 바인딩된 컨트롤이 가리키는 내부 목록에서의 위치를 가져오거나 설정합니다.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

Property Value

Int32

내부 목록에서 위치를 지정하는 0부터 시작하는 인덱스입니다.A zero-based index that specifies a position in the underlying list.

Examples

다음 코드 예제에서는 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


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

Remarks

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.

Applies to

See also