Beispiel #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 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);
        }