private void NewItemButton_Click(object sender, EventArgs e) { NewItemForm f = new NewItemForm(); f.StartPosition = FormStartPosition.CenterParent; f.ShowDialog(this); }
private void dbClickEvent_Click(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; int id = (int)MyItemGrid.Rows[context.Position.Row].Tag; Product o = myItemManager.GetProductById(id); NewItemForm f = new NewItemForm(); f.Text = "编辑产品信息"; f.UpdatedProduct = o; f.ShowDialog(this); }