I have a combobox called combobox1 and I dont know how to save the selection. For example if i selected Sub Compounds, how would i save this so when i loaded it again from the hd Sub Compounds would be selected.
steven8579
11
Light Poster
Recommended Answers
Jump to PostHi!
I made this sample, which saves the combobox item when application terminates and load and select the combobox last saved item when application starts:
private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { System.IO.StreamWriter wr = new System.IO.StreamWriter("C:\\abc.txt"); wr.WriteLine(ComboBox1.Text); wr.Close(); } private void Form1_Load(System.Object sender, System.EventArgs e) …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.