BindingManagerBase.Count Vlastnost

Definice

Při přepsání v odvozené třídě získá počet řádků spravovaných .BindingManagerBase

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

Hodnota vlastnosti

Int32

Počet řádků spravovaných nástrojem BindingManagerBase.

Příklady

Následující příklad kódu ukazuje čtyři metody, které nastavily Position vlastnost. Metoda MoveNext zvýší vlastnost o 1. Metoda MovePrevious dekrementuje vlastnost o 1. Metoda MoveFirst nastaví vlastnost na 0. Metoda MoveLast nastaví vlastnost na hodnotu Count vlastnosti 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

Poznámky

Count Vlastnost slouží k určení poslední položky v seznamu řádků, které BindingManagerBaseudržuje . Pokud chcete přejít na poslední položku, nastavte Position vlastnost na Count hodnotu vlastnosti minus 1.

Platí pro

Viz také