CurrencyManager.RemoveAt メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CurrencyManager.RemoveAt メソッドの意味・解説 

CurrencyManager.RemoveAt メソッド

指定したインデックスにある項目を削除します

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

Public Overrides Sub RemoveAt
 ( _
    index As Integer _
)
Dim instance As CurrencyManager
Dim index As Integer

instance.RemoveAt(index)
public void RemoveAt (
    int index
)

パラメータ

index

リストから削除する項目のインデックス

例外例外
例外種類条件

IndexOutOfRangeException

指定されindex位置に行がありません。

解説解説

RemoveAt メソッドは、 DataGrid コントロールなどの複合コントロールで、項目をリストから削除できるように設計されました。このメソッド使用して実際に項目を削除することはお勧めしません。代わりに、DataView クラスDelete メソッド使用して項目を削除します

使用例使用例

RemoveAt メソッド使用してリストの 0 の位置にある項目を削除するコード例次に示します

Private Sub RemoveFromList()
    ' Get the CurrencyManager of a TextBox control.
    Dim myCurrencyManager As CurrencyManager
 = CType(textBox1.BindingContext(0), CurrencyManager)
    ' If the count is 0, exit the function.
    If myCurrencyManager.Count > 1 Then
        myCurrencyManager.RemoveAt(0)
    End If
    
End Sub 'RemoveFromList
private void RemoveFromList(){
    // Get the CurrencyManager of a TextBox control.
    CurrencyManager myCurrencyManager = (CurrencyManager)textBox1.BindingContext[0];
    // If the count is 0, exit the function.
    if(myCurrencyManager.Count > 1)
    myCurrencyManager.RemoveAt(0);
}
void RemoveFromList()
{
   
   // Get the CurrencyManager of a TextBox control.
   CurrencyManager^ myCurrencyManager = dynamic_cast<CurrencyManager^>(textBox1->BindingContext[nullptr]);
   
   // If the count is 0, exit the function.
   if ( myCurrencyManager->Count > 1 )
         myCurrencyManager->RemoveAt( 0 );
}

private void RemoveFromList()
{
    // Get the CurrencyManager of a TextBox control.
    CurrencyManager myCurrencyManager = 
        (CurrencyManager)(textBox1.get_BindingContext().
        get_Item((System.Int32)0));
    // If the count is 0, exit the function.
    if (myCurrencyManager.get_Count() > 1) {
        myCurrencyManager.RemoveAt(0);
    }
} //RemoveFromList
private function RemoveFromList(){
    // Get the CurrencyManager of a TextBox control.
    var myCurrencyManager : CurrencyManager  = CurrencyManager(textBox1.BindingContext[0]);
    // If the count is 0, exit the function.
    if(myCurrencyManager.Count > 1)
    myCurrencyManager.RemoveAt(0);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

CurrencyManager.RemoveAt メソッドのお隣キーワード
検索ランキング

   

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



CurrencyManager.RemoveAt メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS