Click here to Skip to main content
11,431,483 members (71,060 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I have one combo box, in that i have to store values manually.

when i run in the comboxbox below values as to be display


sunday
monday
tuesday
wednesday
thursday
friday
saturday

for that how can i store the above in combo box using c sharp.

please help me.

how can i do,it is a windows application.
Posted 18-Feb-13 3:31am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

ComboBoxID.Items.Add("sunday");
//and so on...
How to: Add and Remove Items from a Windows Forms ComboBox, ListBox, or CheckedListBox Control[^]

Get your basics done before you start coding!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I hope this will work



private void Form1_Load(object sender, EventArgs e)
   {
       if (Settings.Default.cboCollection != null)
           this.comboBox1.Items.AddRange(Settings.Default.cboCollection.ToArray());
   }
 

   private void Form1_FormClosing(object sender, FormClosingEventArgs e)
   {
       ArrayList arraylist = new ArrayList(this.comboBox1.Items);
       Settings.Default.cboCollection = arraylist;
       Settings.Default.Save();
   }
 
   //A button to add items to the ComboBox
   private int i;
   private void button1_Click(object sender, EventArgs e)
   {
       this.comboBox1.Items.Add(i++);
   }
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100