Nasıl yapılır: Windows Forms DomainUpDown Denetimlerine Programlı Olarak Öğe Ekleme

kodda Windows Forms denetimine öğe ekleyebilirsiniz DomainUpDown . AddInsertDomainUpDown.DomainUpDownItemCollection Denetimin özelliğine öğe eklemek için sınıfının or metodunu çağırın Items . AddYöntemi bir koleksiyonun sonuna bir öğe ekler, ancak Insert Yöntem belirtilen konuma bir öğe ekler.

Yeni bir öğe eklemek için

  1. Öğe Add listesinin sonuna bir öğe eklemek için yöntemini kullanın.

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

    -veya-

  2. InsertBelirtilen konumdaki listeye bir öğe eklemek için yöntemini kullanın.

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

Ayrıca bkz.