CurrencyManager.RemoveAt メソッド
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文


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

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- CurrencyManager.RemoveAt メソッドのページへのリンク