Inheritance: UIEditForm
コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            FEdit frm = new FEdit();

            frm.ShowDialog();
            if (frm.IsOK)
            {
                this.ShowSuccessDialog(frm.Person.ToString());
            }

            frm.Dispose();
        }
コード例 #2
0
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            Person person = new Person();

            person.Name       = "SunnyUI";
            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();
        }