Click here to Skip to main content
11,500,844 members (78,601 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 2: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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 395
1 Maciej Los 215
2 Peter Leow 215
3 DamithSL 165
4 Ralf Meier 134
0 Sergey Alexandrovich Kryukov 435
1 Maciej Los 345
2 DamithSL 285
3 Peter Leow 260
4 OriginalGriff 177


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | 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