private void 添加新用户ToolStripMenuItem_Click(object sender, EventArgs e) { var form = new AddNew(); form.FormClosed += new FormClosedEventHandler(form_FormClosed); form.ShowDialog(); }
private void btnAdd_Click(object sender, EventArgs e) { AddNew addNewForm = new AddNew(); var result = addNewForm.ShowDialog(); var name = ""; var type = ""; var desc = ""; if (result == DialogResult.OK) { name = addNewForm.ElementName; type = addNewForm.Type; desc = addNewForm.Description; InsertNewItem(type, name, desc); PopulateGrids(); } }