private void btn_NewCategory_Click(object sender, EventArgs e) { FrmNEGoodsCategory nrc = new FrmNEGoodsCategory(); nrc.nr = 0; nrc.Owner = this;//设置父窗体 nrc.Show(); }
private void btn_Edit_Click(object sender, EventArgs e) { string gcname = treeView1.SelectedNode.Text; if (gcname != "所有类别") { FrmNEGoodsCategory nrc = new FrmNEGoodsCategory(); nrc.Owner = this;//设置父窗体 nrc.nr = 1; nrc.gcname = gcname; nrc.Show(); } else { MessageBox.Show("请选择类别!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }