private void btnAdd_Click(object sender, EventArgs e) { FEdit frm = new FEdit(); frm.ShowDialog(); if (frm.IsOK) { this.ShowSuccessDialog(frm.Person.ToString()); } frm.Dispose(); }
private void btnEdit_Click(object sender, System.EventArgs e) { Person person = new Person(); person.Name = "MallieUI"; person.Sex = Sex.Male; person.Age = 18; person.Department = "研发部"; person.Birthday = new DateTime(2002, 1, 1); FEdit frm = new FEdit(); frm.Person = person; frm.ShowDialog(); if (frm.IsOK) { this.ShowSuccessDialog(frm.Person.ToString()); } frm.Dispose(); }