BindingManagerBase.Count プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
派生クラスでオーバーライドされると、 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 プロパティを設定する 4 つのメソッドを示しています。
MoveNext メソッドは、プロパティを 1 ずつインクリメントします。
MovePrevious メソッドは、プロパティを 1 ずつデクリメントします。
MoveFirstメソッドは、プロパティを 0 に設定します。
MoveLast メソッドは、プロパティを 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 );
}
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によって管理される行の一覧の最後の項目を決定します。 最後の項目に移動するには、 Position プロパティを Count プロパティ値から 1 を引いた値に設定します。