BindingManagerBase.Count 속성

정의

파생 클래스에서 재정의된 경우 BindingManagerBase가 관리하는 행의 수를 가져옵니다.

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

속성 값

BindingManagerBase가 관리하는 행의 수입니다.

예제

다음 코드 예제를 설정 하는 네 가지 메서드를 보여 줍니다는 Position 속성입니다. 메서드는 MoveNext 속성을 1씩 증분합니다. 메서드는 MovePrevious 속성을 1로 감소합니다. 메서드는 MoveFirst 속성을 0으로 설정합니다. 메서드는 MoveLast 속성을 속성 값에서 1을 뺀 값으로 Count 설정합니다.

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

설명

사용 하 여는 Count 속성에서 유지 관리 하는 행 목록에서 마지막 항목을 확인 합니다 BindingManagerBase. 마지막 항목으로 이동하려면 속성을 속성 값에서 1을 Count 뺀 값으로 설정합니다Position.

적용 대상

추가 정보