/// <summary> /// ctor /// </summary> public ValueUpDown() { #region container+tracker this._trackerpopup = new TrackerPopupForm(); this._trackerpopup.ValueChanged+=new ValueChangedEH(_tracker_ValueChanged); this._trackerpopup.VisibleChanged += new EventHandler(_trackerpopup_VisibleChanged); this._trackerpopup.TrackerOrientation = TrackerOrientation; #endregion #region textbox this._textbox = new TextBox(); this._textbox.Size = new Size(this.Width - 32, 20); this._textbox.Location = new Point(2, 4); this._textbox.BorderStyle = BorderStyle.None; this._textbox.Text = this.Minimum.ToString(); this._textbox.BackColor = Color.White; this._textbox.MaxLength = 5; this._textbox.KeyDown += new KeyEventHandler(_textbox_KeyDown); this._textbox.KeyPress += new KeyPressEventHandler(_textbox_KeyPress); this._textbox.LostFocus += new EventHandler(_textbox_LostFocus); this.Controls.Add(this._textbox); #endregion #region timer this._timer = new Timer(); this._timer.Tick += new EventHandler(_timer_Tick); #endregion this.Size = new Size(72, 25); this.SetStyle(ControlStyles.ResizeRedraw | ControlStyles.FixedHeight | ControlStyles.DoubleBuffer, true); }
/// <summary> /// ctor /// </summary> public ValueUpDown() { #region container+tracker this._trackerpopup = new TrackerPopupForm(); this._trackerpopup.ValueChanged += new ValueChangedEH(_tracker_ValueChanged); this._trackerpopup.VisibleChanged += new EventHandler(_trackerpopup_VisibleChanged); this._trackerpopup.TrackerOrientation = TrackerOrientation; #endregion #region textbox this._textbox = new TextBox(); this._textbox.Size = new Size(this.Width - 32, 20); this._textbox.Location = new Point(2, 4); this._textbox.BorderStyle = BorderStyle.None; this._textbox.Text = this.Minimum.ToString(); this._textbox.BackColor = Color.White; this._textbox.MaxLength = 5; this._textbox.KeyDown += new KeyEventHandler(_textbox_KeyDown); this._textbox.KeyPress += new KeyPressEventHandler(_textbox_KeyPress); this._textbox.LostFocus += new EventHandler(_textbox_LostFocus); this.Controls.Add(this._textbox); #endregion #region timer this._timer = new Timer(); this._timer.Tick += new EventHandler(_timer_Tick); #endregion this.Size = new Size(72, 25); this.SetStyle(ControlStyles.ResizeRedraw | ControlStyles.FixedHeight | ControlStyles.DoubleBuffer, true); }