ComboBox::ObjectCollection::Add Method (Object^)
Adds an item to the list of items for a ComboBox.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
This method adds an item to the combo box. If the Sorted property of the ComboBox is set to true, the item is inserted into the list alphabetically. Otherwise, the item is inserted at the end of the list.
A visual representation of the item is displayed in the combo box. This content representation is specified by the DisplayMember property. If the DisplayMember property is null, the item's ToString method is called to obtain the string that is displayed in the combo box; otherwise, the property of the stored object as specified by the DisplayMember property is displayed. A SystemException occurs if there is insufficient space available to store the new item. To add a set of items to the combo box it is best to use the AddRange method. If you choose to use the method to add a number of items to the combo box, use the BeginUpdate method to suspend repainting during your add and the EndUpdate method to resume repainting. You can use the Insert method to specify the location in the list where an item is added. When an object is added to the collection, the ComboBox calls the object's ToString method to obtain the string to display in the list.
Available since 1.1