public TouchNumberBox() { if (_PopupForm == null || _PopupForm.IsDisposed) { _PopupForm = new TouchNumberBoxForm(); _PopupForm.AddEvent += FormAddEvent; _PopupForm.SubtractEvent += FormSubtractEvent; } Step = 1; Direction = PopupDirection.Right; Value = null; Leave += TouchNumberBoxLeave; }
protected override void OnClick(EventArgs e) { base.OnClick(e); Leave -= TouchNumberBoxLeave; if (_PopupForm == null || _PopupForm.IsDisposed) { _PopupForm = new TouchNumberBoxForm(); _PopupForm.AddEvent += FormAddEvent; _PopupForm.SubtractEvent += FormSubtractEvent; } SetPopupLocation(); if (!_PopupForm.Visible) { _PopupForm.Show(this); } Focus(); Leave += TouchNumberBoxLeave; }