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

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

CurrencyManager.Position プロパティ

リスト内の現在の位置取得または設定します

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

解説解説

Position プロパティは、CurrencyManager クラス重要なプロパティです。項目のリストでは、リスト全体のうち 1 つの項目のみ表示できます表示する項目を決定するには、Position を 0 (リスト先頭) から Count -1 (リスト末尾) までの数値設定します

たがってPosition は、同じ CurrencyManagerバインドされているすべてのコントロールの現在性、つまりリスト内の位置決定します。たとえば、"FirstName" および "LastName" という 2 つの列で構成されるリストがあるとします。このリストには、2 つTextBox コントロールバインドされています。つまり、一方コントロール最初の列に、もう一方コントロール2 番目の列にバインドされています。共通する CurrencyManagerPosition3 番目の位置設定されている場合、どちらのコントロールにも、リスト内のその位置相当する値が表示されます。つまり、3 番目の位置にある項目が "John" という名前と "Smith" という姓で構成されている場合バインド コントロールには "John" と "Smith" が表示されます。

使用例使用例

Position プロパティ使用してリスト内を移動できるようにするコード例次に示します

Private Sub MoveNext(ByVal
 myCurrencyManager As CurrencyManager)
    If myCurrencyManager.Count = 0 Then
       Console.WriteLine("No records to move to.")
       Exit Sub
    End If
 
    If myCurrencyManager.Position = myCurrencyManager.Count -
 1 Then 
       MessageBox.Show("You're at end of the records")
    Else
       myCurrencyManager.Position += 1
    End If
 End Sub
 
 Private Sub MoveFirst(ByVal
 myCurrencyManager As CurrencyManager)
    If myCurrencyManager.Count = 0 Then
       Console.WriteLine("No records to move to.")
       Exit Sub
    End If
 
    myCurrencyManager.Position = 0
 End Sub
 
 Private Sub MovePrevious(ByVal
 myCurrencyManager As CurrencyManager)
    If myCurrencyManager.Count = 0 Then
       Console.WriteLine("No records to move to.")
       Exit Sub
    End If
 
    If myCurrencyManager.Position = 0 Then
       MessageBox.Show("You're at the beginning of the records.")
    Else
       myCurrencyManager.Position -= 1
    End if
 End Sub
 
 Private Sub MoveLast(ByVal
 myCurrencyManager As CurrencyManager)
    If myCurrencyManager.Count = 0 Then
       Console.WriteLine("No records to move to.")
       Exit Sub
    End If
 
    myCurrencyManager.Position = myCurrencyManager.Count - 1
 End Sub
   
private void MoveNext(CurrencyManager myCurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
    if (myCurrencyManager.Position == myCurrencyManager.Count
 - 1){
       Console.WriteLine("You're at end of the records");
    }
    else{
      myCurrencyManager.Position += 1;
    }
 }
 
 private void MoveFirst(CurrencyManager myCurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
 
    myCurrencyManager.Position = 0;
 }
 
 private void MovePrevious(CurrencyManager
 myCurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
    if(myCurrencyManager.Position == 0) {
       Console.WriteLine("You're at the beginning of the records.");
    }   
    else{
       myCurrencyManager.Position -= 1;
    }
 }
 
 private void MoveLast(CurrencyManager myCurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
    myCurrencyManager.Position = myCurrencyManager.Count - 1;
 }
   
private:
   void MoveNext( CurrencyManager^ myCurrencyManager )
   {
      if ( myCurrencyManager->Count == 0 )
      {
         Console::WriteLine( "No records to move to." );
         return;
      }

      if ( myCurrencyManager->Position == myCurrencyManager->Count
 - 1 )
      {
         Console::WriteLine( "You're at end of the records" );
      }
      else
      {
         myCurrencyManager->Position += 1;
      }
   }

   void MoveFirst( CurrencyManager^ myCurrencyManager )
   {
      if ( myCurrencyManager->Count == 0 )
      {
         Console::WriteLine( "No records to move to." );
         return;
      }

      myCurrencyManager->Position = 0;
   }

   void MovePrevious( CurrencyManager^ myCurrencyManager )
   {
      if ( myCurrencyManager->Count == 0 )
      {
         Console::WriteLine( "No records to move to." );
         return;
      }

      if ( myCurrencyManager->Position == 0 )
      {
         Console::WriteLine( "You're at the beginning of the records."
 );
      }
      else
      {
         myCurrencyManager->Position -= 1;
      }
   }

   void MoveLast( CurrencyManager^ myCurrencyManager )
   {
      if ( myCurrencyManager->Count == 0 )
      {
         Console::WriteLine( "No records to move to." );
         return;
      }
      myCurrencyManager->Position = myCurrencyManager->Count - 1;
   }
private void MoveNext(CurrencyManager myCurrencyManager)
{
    if (myCurrencyManager.get_Count() == 0) {
        Console.WriteLine("No records to move to.");
        return ;
    }
    if (myCurrencyManager.get_Position() == 
        myCurrencyManager.get_Count() - 1) {
        Console.WriteLine("You're at end of the records");
    }
    else {
        myCurrencyManager.set_Position(
            myCurrencyManager.get_Position() + 1);
    }
} //MoveNext

private void MoveFirst(CurrencyManager myCurrencyManager)
{
    if (myCurrencyManager.get_Count() == 0) {
        Console.WriteLine("No records to move to.");
        return ;
    }
    myCurrencyManager.set_Position(0);
} //MoveFirst

private void MovePrevious(CurrencyManager myCurrencyManager)
{
    if (myCurrencyManager.get_Count() == 0) {
        Console.WriteLine("No records to move to.");
        return;
    }
    if (myCurrencyManager.get_Position() == 0) {
        Console.WriteLine("You're at the beginning of the records.");
    }
    else {
        myCurrencyManager.set_Position(
            myCurrencyManager.get_Position() - 1);
    }
} //MovePrevious

private void MoveLast(CurrencyManager myCurrencyManager)
{
    if (myCurrencyManager.get_Count() == 0) {
        Console.WriteLine("No records to move to.");
        return ;
    }
    myCurrencyManager.set_Position(myCurrencyManager.get_Count() - 1);
} //MoveLast
private function MoveNext(myCurrencyManager
 : CurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
    if (myCurrencyManager.Position == myCurrencyManager.Count
 - 1){
       Console.WriteLine("You're at end of the records");
    }
    else{
      myCurrencyManager.Position += 1;
    }
 }
 
 private function MoveFirst(myCurrencyManager
 : CurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
 
    myCurrencyManager.Position = 0;
 }
 
 private function MovePrevious(myCurrencyManager
 : CurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
    if(myCurrencyManager.Position == 0) {
       Console.WriteLine("You're at the beginning of the records.");
    }   
    else{
       myCurrencyManager.Position -= 1;
    }
 }
 
 private function MoveLast(myCurrencyManager
 : CurrencyManager){
    if(myCurrencyManager.Count == 0) {
       Console.WriteLine("No records to move to.");
       return;
    }
    myCurrencyManager.Position = myCurrencyManager.Count - 1;
 }
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CurrencyManager クラス
CurrencyManager メンバ
System.Windows.Forms 名前空間
CurrencyManager.List プロパティ
CurrencyManager.Count プロパティ
CurrencyManager.Current プロパティ


このページでは「.NET Framework クラス ライブラリ リファレンス」からCurrencyManager.Position プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からCurrencyManager.Position プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からCurrencyManager.Position プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

CurrencyManager.Position プロパティのお隣キーワード
検索ランキング

   

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



CurrencyManager.Position プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS