How can i add the data to listbox1 by pressing the Save button.I have done the code of listbox1 but not of the button.Below is the code
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
listBox1.Items.Add(textBox1.Text);
listBox1.Items.Add(textBox2.Text);
listBox1.Items.Add(textBox3.Text);
listBox1.Items.Add(textBox4.Text);
}
}
}
If you want on button click the same thing to happen as on SelectedIndexChanged(), you just copy the code.
If this is not it, you have to give more information about what should happen.