I have a question about saving content from a listbox and putting it in a .ini file.
Also i want to retrieve the information and put it back in the listbox when the programm starts.
I have two listboxes lets call them listBox1
and listBox2
.
And 1 button lets call that selectbttn
.
The content from listBox2
must be saved when i click on the select button. ,br />
How can i fix this?
This is the code with the 2 listboxes, id ont have a code for the select button. The button that you see in the code is a add button that adds content from listbox1 to listbox 2.
private void add_button_Click(object sender, EventArgs e)
{
try
{
if (list_selected.Items.Contains(List_selection.SelectedItem))
{
MessageBox.Show("Can not add the type twice.");
}
else
{
list_selected.Items.Add(List_selection.SelectedItem);
}
}
catch
{
{
MessageBox.Show("No type selected");
}
}
}