private void BuildForm() { if (fvoucher == null) { fvoucher = new FVoucher(); } fvoucher.FVoucher_NeedToRefresh += VVoucher_NeedToRefresh; Parent.Controls.Add(fvoucher); fvoucher.Dock = DockStyle.Fill; fvoucher.Show(); fvoucher.BringToFront(); }
void Listgrid_RowAction(object sender, EventArgs e) { if (listgrid.SelectedRow == null) { return; } if (fvoucher == null) { fvoucher = new FVoucher(); } BuildForm(); string pkValue = GetSelectedPkValue(); if (pkValue != null) { fvoucher.SetAction(BtnEvent.Open, pkValue); } }