void TimerAnimation_Tick(object sender, EventArgs e) { if (Deployed) { if (OriginalHeight - this.Height == 1) { this.Height = OriginalHeight; TimerAnimation.Stop(); } else { this.Height += (int)Math.Ceiling((OriginalHeight - this.Height) / 5.0); } } else { if (this.Height - ReducedHeight == 1) { this.Height = ReducedHeight; TimerAnimation.Stop(); foreach (Control c in Controls) { c.Visible = false; } ButtonArrow.Visible = true; ButtonArrow.Focus(); } else { this.Height -= (int)Math.Ceiling((this.Height - ReducedHeight) / 5.0); } } }
void GroupBoxPlus_SizeChanged(object sender, EventArgs e) { ButtonArrow.SetBounds(this.Width - ButtonArrow.Width - 5, 10, ButtonArrow.Width, ButtonArrow.Height); }
public RegisterBox() { _imageDisabled = null; _imageDown = null; _imageNormal = null; _imageOver = null; _icon = null; _buttonMouseState = ButtonMouseState.Normal; _buttonStyle = ButtonStyle.Standard; _controlRegion = ControlRegion.RoundedRectangle; _iconSize = new Size(32, 32); _buttonArrow = ButtonArrow.None; BackColor = Color.Transparent; UseVisualStyleBackColor = false; this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.Selectable, false); this.Refresh(); }