次の方法で共有


方法: Windows フォームの DomainUpDown コントロールから項目を削除する

DomainUpDown.DomainUpDownItemCollection クラスの Remove または RemoveAt メソッドを呼び出すと、Windows フォーム DomainUpDown コントロールから項目を削除することができます。 Remove メソッドを使用すると、特定の項目が削除されますが、RemoveAt メソッドを使用すると、位置を使用して項目が削除されます。

アイテムを削除するには

  • 項目を名前で削除するには、DomainUpDown.DomainUpDownItemCollection クラスの Remove メソッドを使用します。

    DomainUpDown1.Items.Remove("noodles")  
    
    domainUpDown1.Items.Remove("noodles");  
    
    domainUpDown1->Items->Remove("noodles");  
    

    \- または -

  • 項目を位置を使用して削除するには、RemoveAt メソッドを使用します。

    ' Removes the first item in the list.  
    DomainUpDown1.Items.RemoveAt(0)  
    
    // Removes the first item in the list.  
    domainUpDown1.Items.RemoveAt(0);  
    
    // Removes the first item in the list.  
    domainUpDown1->Items->RemoveAt(0);  
    

関連項目