private void Button3_Click(object sender, EventArgs e) { EditPCategory epc = new EditPCategory(); epc.Show(); epc.VisibleChanged += formVisibleChanged; }
private void formVisibleChanged(object sender, EventArgs e) { EditPCategory epc = (EditPCategory)sender; if (!epc.Visible) { this.txtno.Text = epc.ReturnText; this.txtname.Text = epc.ReturnName; this.txtdesc.Text = epc.ReturnDesc; btnsave.Text = "Update"; epc.Dispose(); } }