BindingManagerBase.Position Özellik

Tanım

Türetilmiş bir sınıfta geçersiz kılındığında, temel alınan listede bu veri kaynağı noktasına bağlı olan denetimin konumunu alır veya ayarlar.

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

Özellik Değeri

Temel alınan listede bir konum belirten sıfır tabanlı dizin.

Örnekler

Aşağıdaki kod örneği, özelliğini ayarlayan Position dört yöntemi gösterir. yöntemi özelliği MoveNext 1 artırır. yöntemi özelliği MovePrevious 1'e kadar geriler. MoveFirst yöntemi özelliği 0 olarak ayarlar ve MoveLast yöntemi özelliği eksi 1 özelliğinin Count değerine ayarlar.

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

Açıklamalar

Position tarafından BindingManagerBasetutulan temel alınan listede yinelemek için özelliğini kullanın. İlk öğeye gitmek için değerini 0 olarak ayarlayın Position . Listenin sonuna gitmek için değerini özelliğin Count değeri eksi 1 olarak ayarlayınPosition.

Olay, PositionChanged özellik değeri değiştiğinde Position gerçekleşir.

Şunlara uygulanır

Ayrıca bkz.