* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
2.4 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|---|
| Add Items to DomainUpDown Controls Programmatically | 03/30/2017 |
|
|
fd31d314-33eb-4181-90f8-d32ed0c4e072 |
How to: Add Items to Windows Forms DomainUpDown Controls Programmatically
You can add items to the Windows Forms xref:System.Windows.Forms.DomainUpDown control in code. Call the xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection.Add%2A or xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection.Insert%2A method of the xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection class to add items to the control's xref:System.Windows.Forms.DomainUpDown.Items%2A property. The xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection.Add%2A method adds an item to the end of a collection, while the xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection.Insert%2A method adds an item at a specified position.
To add a new item
-
Use the xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection.Add%2A 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 xref:System.Windows.Forms.DomainUpDown.DomainUpDownItemCollection.Insert%2A 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");