private void btnMore_Click(object sender, EventArgs e) { if (this.btnMore.Text == "More =>") { this.btnMore.Text = "<= Less"; this.colorPickerMultiEx1 = new ColorPickerMultiEx(); this.colorPickerMultiEx1.ColorChanged += new EventHandler(colorPickerMultiEx1_ColorChanged); this.Controls.Add(this.colorPickerMultiEx1); this.colorPickerMultiEx1.ColorObject = this.ColorObject; this.colorPickerMultiEx1.Location = new Point(this.btnMore.Right + 4, 0); this.Width += this.colorPickerMultiEx1.Width; //this.btnMore.Top = this.colorPickerMultiEx1.Bottom - this.btnMore.Height; int dragbarHeight = this.Height - this.ClientRectangle.Height; this.Height = this.colorPickerMultiEx1.Bottom + 3 + dragbarHeight; } else { this.btnMore.Text = "More =>"; this.Width -= this.colorPickerMultiEx1.Width; this.colorPickerMultiEx1.Dispose(); this.colorPickerMultiEx1 = null; //this.btnMore.Top = this.tbColorText.Bottom - this.btnMore.Height; int dragbarHeight = this.Height - this.ClientRectangle.Height; this.Height = this.tbColorText.Bottom + 3 + dragbarHeight; } }
private void btnMore_Click(object sender, EventArgs e) { if (this.btnMore.Text == "More =>") { this.btnMore.Text = "<= Less"; this.colorPickerMultiEx1 = new ColorPickerMultiEx(); this.colorPickerMultiEx1.ColorChanged+=new EventHandler(colorPickerMultiEx1_ColorChanged); this.Controls.Add(this.colorPickerMultiEx1); this.colorPickerMultiEx1.ColorObject = this.ColorObject; this.colorPickerMultiEx1.Location = new Point(this.btnMore.Right + 4, 0); this.Width += this.colorPickerMultiEx1.Width; //this.btnMore.Top = this.colorPickerMultiEx1.Bottom - this.btnMore.Height; int dragbarHeight = this.Height - this.ClientRectangle.Height; this.Height = this.colorPickerMultiEx1.Bottom + 3 + dragbarHeight; } else { this.btnMore.Text = "More =>"; this.Width -= this.colorPickerMultiEx1.Width; this.colorPickerMultiEx1.Dispose(); this.colorPickerMultiEx1 = null; //this.btnMore.Top = this.tbColorText.Bottom - this.btnMore.Height; int dragbarHeight = this.Height - this.ClientRectangle.Height; this.Height = this.tbColorText.Bottom + 3 + dragbarHeight; } }