private void button1_Click(object sender, EventArgs e) { AddEventArgs ea = new AddEventArgs(); ea.name = this.listBox1.SelectedItem.ToString(); AddObject(this, ea); this.Hide(); }
void nf_AddObject(object sender, AddEventArgs e) { MessageBox.Show(e.name); }