BindingManagerBase.Count Özellik

Tanım

Türetilmiş bir sınıfta geçersiz kılındığında, tarafından BindingManagerBaseyönetilen satır sayısını alır.

public:
 abstract property int Count { int get(); };
public abstract int Count { get; }
member this.Count : int
Public MustOverride ReadOnly Property Count As Integer

Özellik Değeri

Int32

tarafından BindingManagerBaseyönetilen satır sayısı.

Ö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ğini 0 olarak ayarlar. yöntemi özelliği MoveLast 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

Count tarafından BindingManagerBasetutulan satırlar listesindeki son öğeyi belirlemek için özelliğini kullanın. Son öğeye gitmek için özelliği Count eksi 1 özellik değerine ayarlayınPosition.

Şunlara uygulanır

Ayrıca bkz.