コード例 #1
0
ファイル: GroupBoxPlus.cs プロジェクト: Omybot/GoBot
        private void Open(bool animation = false)
        {
            Deployed = true;

            if (OriginalHeight == 0)
            {
                return;
            }

            foreach (Control c in Controls)
            {
                c.Visible = true;
            }

            ButtonArrow.Image = Properties.Resources.ArrowUp;

            Deployed = true;

            if (animation)
            {
                TimerAnimation          = new Timer();
                TimerAnimation.Interval = 20;
                TimerAnimation.Tick    += new EventHandler(TimerAnimation_Tick);
                TimerAnimation.Start();
            }
            else
            {
                this.Height = OriginalHeight;
            }

            DeployedChanged?.Invoke(true);
        }
コード例 #2
0
ファイル: GroupBoxPlus.cs プロジェクト: Omybot/GoBot
        private void Close(bool animation = false)
        {
            Deployed = false;

            if (OriginalHeight == 0)
            {
                OriginalHeight = this.Height;
            }

            ButtonArrow.Image = Properties.Resources.ArrowBottom;

            Deployed = false;

            if (animation)
            {
                TimerAnimation          = new Timer();
                TimerAnimation.Interval = 20;
                TimerAnimation.Tick    += new EventHandler(TimerAnimation_Tick);
                TimerAnimation.Start();
            }
            else
            {
                this.Height = ReducedHeight;
                foreach (Control c in Controls)
                {
                    c.Visible = false;
                }

                ButtonArrow.Visible = true;
            }

            DeployedChanged?.Invoke(false);
        }