BindingManagerBase.Position プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > BindingManagerBase.Position プロパティの意味・解説 

BindingManagerBase.Position プロパティ

派生クラスでオーバーライドされると、このデータ ソースにバインドされたコントロールが指す、基になるリストでの位置を取得または設定します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

解説解説

Position プロパティを使用して、BindingManagerBase によって維持されている、基になるリストを反復処理します。最初の項目に移動するには、Position を 0 に設定します。リストの末尾に移動するには、Position を Count プロパティから 1 を引いた値に設定します。

PositionChanged イベントは、Position プロパティの値が変更されると発生します。

使用例使用例

Position プロパティを設定する 4 つのメソッドのコード例を次に示します。MoveNext メソッドは、プロパティを 1 ずつインクリメントします。MovePrevious メソッドは、プロパティを 1 ずつデクリメントします。MoveFirst メソッドは、プロパティを 0 に設定します。MoveLast メソッドは、プロパティを 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 'BindingManagerBase_CurrentChanged


Private Sub MoveNext()
    ' Increment the Position property value by one.
    myBindingManagerBase.Position += 1
End Sub 'MoveNext


Private Sub MovePrevious()
    ' Decrement the Position property value by one.
    myBindingManagerBase.Position -= 1
End Sub 'MovePrevious


Private Sub MoveFirst()
    ' Go to the first item in the list.
    myBindingManagerBase.Position = 0
End Sub 'MoveFirst


Private Sub MoveLast()
    ' Go to the last row in the list.
    myBindingManagerBase.Position = myBindingManagerBase.Count - 1
End Sub 'MoveLast
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:
   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)).get_Current());
} //BindingManagerBase_CurrentChanged

private void MoveNext()
{
    // Increment the Position property value by one.
    myBindingManagerBase.set_Position(myBindingManagerBase.get_Position()
        + 1);
} //MoveNext

private void MovePrevious()
{
    // Decrement the Position property value by one.
    myBindingManagerBase.set_Position(myBindingManagerBase.get_Position() 
        - 1);
} //MovePrevious

private void MoveFirst()
{
    // Go to the first item in the list.
    myBindingManagerBase.set_Position(0);
} //MoveFirst

private void MoveLast()
{
    // Go to the last row in the list.
    myBindingManagerBase.set_Position(myBindingManagerBase.get_Count() - 1);
} //MoveLast
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
BindingManagerBase クラス
BindingManagerBase メンバ
System.Windows.Forms 名前空間
PositionChanged
BindingManagerBase.Current プロパティ
BindingManagerBase.Count プロパティ



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「BindingManagerBase.Position プロパティ」の関連用語

BindingManagerBase.Position プロパティのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



BindingManagerBase.Position プロパティのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS