Esempio n. 1
0
        public MaterialTextBox_WOC()
        {
            InitializeComponent();

            DoubleBuffered  = true;
            _animationTimer = new AnimatorTimer_WOC(Utils_WOC.getFormForThreading());

            _animationTimer.OnAnimationTimerTick += (int progress) =>
            {
                _animationProgress = progress;
                Invalidate();
            };
            textBox.LostFocus += (sender, e) =>
            {
                _focused = false;
                _animationTimer.SetValueRange(0, AnimationLength, true);
            };
            textBox.GotFocus   += (sender, e) => _focused = true;
            textBox.MouseEnter += (sender, e) => _animationTimer.SetValueRange(Width / 2f, AnimationLength, true);
            textBox.MouseLeave += (sender, e) =>
            {
                if (!_focused)
                {
                    _animationTimer.SetValueRange(0, AnimationLength, true);
                }
            };
        }
 public AnimatorTimer_WOC(Control control)
 {
     _invokeControl = control;
     if (!_isFrequencyChecked)
     {
         _isFrequencyChecked = true;
         int frequency = Utils_WOC.getMonitorFrequency();
         _displayRefreshRate = frequency != -1 ? frequency : 60;
     }
     _interval = 1000 / _animationFps;
 }
Esempio n. 3
0
        public DropDown_WOC()
        {
            DoubleBuffered  = true;
            _animationTimer = new AnimatorTimer_WOC(Utils_WOC.getFormForThreading());
            _animationTimer.OnAnimationTimerTick += (value) =>
            {
                _control.FindForm().SuspendLayout();
                _value          = value;
                _control.Height = value;
                _control.FindForm().ResumeLayout();
                _updated = true;
                Invalidate();
            };

            DoubleClick += (s, e) => OnClick(e);
        }