Share via


How to: Remove Items from Windows Forms DomainUpDown Controls

You can remove items from the Windows Forms DomainUpDown control by calling the Remove or RemoveAt method of the DomainUpDownItemCollection class. The Remove method removes a specific item, while the RemoveAt method removes an item by its position.

To remove an item

  • Use the Remove method of the DomainUpDownItemCollection class to remove an item by name.

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

    -or-

  • Use the RemoveAt method to remove an item by its position.

    ' 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);
    

See Also

Reference

DomainUpDown Control Overview (Windows Forms)
DomainUpDown Class
DomainUpDown.DomainUpDownItemCollection.Remove Method
DomainUpDown.DomainUpDownItemCollection.RemoveAt Method

Other Resources

DomainUpDown Control (Windows Forms)