I want to have buttons in one form, then as I click on them, an item is added to a list in another form.
This is my current code, take in mind that in this code the buttons are in the same form as the listview, and I want to move either to a new one:
private void button2_Click(object sender, EventArgs e)
{
listView1.Items.Add("Panama");
}
private void button3_Click(object sender, EventArgs e)
{
listView1.Items.Add("Brazil");
}
private void button4_Click(object sender, EventArgs e)
{
listView1.Items.RemoveAt(0);
}
How do I do so when the button is clicked, the list in another form gets the item added?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…