private void btnAdd_Click(object sender, EventArgs e) { if (addCtl == null) { addCtl = new SettingControl(this); addCtl.Parent = Parent; addCtl.GetLabel1.Text = "添加"; } addCtl.Location = Location; this.Visible = false; addCtl.Visible = true; }
private void btnChange_Click(object sender, EventArgs e) { if (sc == null) { sc = new SettingControl(this); sc.Parent = Parent.Parent.Parent; sc.GetLabel1.Text = "修改"; } sc.Location = this.Parent.Parent.Location; this.Parent.Parent.Visible = false; sc.Visible = true; }