您可以在程式碼中將項目新增至 Windows Forms DomainUpDown 控制項。 呼叫 Add 類別的 Insert 或 DomainUpDown.DomainUpDownItemCollection 方法,將項目新增至控制項的 Items 屬性。 Add 方法會將項目新增至集合結尾,而 Insert 方法會在指定的位置新增項目。
新增項目
使用 Add 方法,將項目新增至項目清單的結尾。
DomainUpDown1.Items.Add("noodles")domainUpDown1.Items.Add("noodles");domainUpDown1->Items->Add("noodles");-或-
使用 Insert 方法,將項目插入清單中的指定位置。
' 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");