Exemplo n.º 1
0
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            if (AllowWheel && UsedFilter == Filter.Digits)
            {
                float newValue = ParseFloatValue(lastGoodText) + (WheelStepValue * Funcs.Force(Funcs.ToInt(e.Delta)));

                if (!IgnoreClamping)
                {
                    this.Text = (newValue < Minimum ? Minimum : (newValue > Maximum ? Maximum : newValue)).ToString();
                }

                this.Select(this.Text.Length, 0);
            }

            base.OnMouseWheel(e);
        }
Exemplo n.º 2
0
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            if (UsedFilter == Filter.DigitsOnly)
            {
                int newValue = Funcs.ToInt(this.Text) + (Wheel_StepValue * Funcs.Force(Funcs.ToInt(e.Delta)));

                if (!IgnoreClampig)
                {
                    this.Text = Funcs.Clamp(newValue, MinimumValue, MaximumValue).ToString();
                }

                this.Select(this.Text.Length, 0);
            }

            base.OnMouseWheel(e);
        }