private void Button() { try { if (!LimitShow) { f = new frmLimit(FormEmployee.ID); f.Location = new Point(this.Right, this.Top); LimitShow = true; button1.Text = "权限<<"; f.Show(); } else { Limitstr = ""; Limitstr = f.getLimitStr(); button1.Text = "权限>>"; LimitShow = false; f.Dispose(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnLimit_Click(object sender, EventArgs e) { try { if (!LimitShow) { f = new frmLimit(); f.Left = this.Right; f.Top = this.Top; f.Location = new Point(this.Right, this.Top); //MessageBox.Show((this.Right).ToString()); //MessageBox.Show(f.Left.ToString()); LimitShow = true; btnLimit.Text = "权限<<"; f.Show(); } else { Limitstr = ""; Limitstr = f.getLimitStr(); f.Dispose(); btnLimit.Text = "权限>>"; LimitShow = false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }