How to: Add Items to Windows Forms DomainUpDown Controls Programmatically
You can add items to the Windows Forms DomainUpDown control in code. Call the Add or Insert method of the DomainUpDown.DomainUpDownItemCollection class to add items to the control's Items property. The Add method adds an item to the end of a collection, while the Insert method adds an item at a specified position.
To add a new item
Use the Add method to add an item to the end of the list of items.
DomainUpDown1.Items.Add("noodles")
domainUpDown1.Items.Add("noodles");
domainUpDown1->Items->Add("noodles");
-or-
Use the Insert method to insert an item into the list at a specified position.
' Inserts an item at the third position in the list DomainUpDown1.Items.Insert(2, "rice")
// Inserts an item at the third position in the list domainUpDown1.Items.Insert(2, "rice");
// Inserts an item at the third position in the list domainUpDown1->Items->Insert(2, "rice");
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET Desktop feedback