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);
                }
            };
        }
Esempio n. 2
0
 protected override void OnClick(EventArgs e)
 {
     base.OnClick(e);
     _animationTimer.SetValueRange(_isExpanded ? 0 : _expandedControlHeight, _control.Height, AnimationLength,
                                   true);
     _isExpanded = !_isExpanded;
 }
Esempio n. 3
0
 public void Animate(int animationLength, int value)
 {
     AnimatorTimer.SetValueRange(value, Animation == Animations.ChangeWidth ? _control.Width : _control.Height,
                                 animationLength, true);
 }