示例#1
0
        //TODO: I have to refactor this code here
        private void Timer_Panel_Tick(object sender, EventArgs e)
        {
            if (Hidden)
            {
                Panel_Slide.Visible = true;
                // Panel_Slide.BringToFront();
                Panel_Slide.Height = Panel_Slide.Height + 10;
                if (Panel_Slide.Height >= panelHeight)
                {
                    Timer_Panel.Stop();
                    Hidden = false;
                    this.Refresh();
                }
            }
            else
            {
                Panel_Slide.Height = Panel_Slide.Height - 10;

                if (Panel_Slide.Height <= 0)
                {
                    Timer_Panel.Stop();
                    Hidden = true;
                    this.Refresh();
                }
            }
        }
示例#2
0
        public Form_Principal()
        {
            InitializeComponent();

            panelHeight         = Panel_Slide.Height;
            Hidden              = false;
            Panel_Slide.Visible = false;
            Timer_Panel.Start();
        }
示例#3
0
        private void Timer_Panel_Tick(object sender, EventArgs e)
        {
            if (Opacity < 0.5)
            {
                return;
            }
            int offset = 6;

            if (MouseMoveNeedShowPanel)
            {
                if (Button_Control_Close.Top + offset >= 1)
                {
                    Button_Control_Close.Top = 1;
                }
                else
                {
                    Button_Control_Close.Top += offset;
                }
                if (Panel_Control.Top - offset <= Height - Panel_Control.Height)
                {
                    Panel_Control.Top      = Height - Panel_Control.Height;
                    MouseMoveNeedShowPanel = false;
                    Timer_Panel.Stop();
                }
                else
                {
                    Panel_Control.Top -= offset;
                }
            }
            else
            {
                if (Button_Control_Close.Top - offset <= -50)
                {
                    Button_Control_Close.Top = -50;
                }
                else
                {
                    Button_Control_Close.Top -= offset;
                }
                if (Panel_Control.Top + offset >= Height)
                {
                    Panel_Control.Top = Height;
                    Timer_Panel.Stop();
                }
                else
                {
                    Panel_Control.Top += offset;
                }
            }
        }
示例#4
0
        private void Timer_GetCurPos_Tick(object sender, EventArgs e)
        {
            int x = Cursor.Position.X;
            int y = Cursor.Position.Y;

            if (x >= Left && x <= Left + Width && y >= Top && y <= Top + Height)
            {
                MouseMoveNeedShowPanel = true;
                Timer_Panel.Start();
            }
            else
            {
                MouseMoveNeedShowPanel = false;
                Timer_Panel.Start();
            }
        }
示例#5
0
 //para mostrar el panel
 private void MostrarPanel()
 {
     if (Hidden)
     {
         // Panel_Slide.Visible = true;
         Panel_Slide.BringToFront();
         Timer_Panel.Start();
         Panel_Slide.Height = Panel_Slide.Height + 10;
         if (Panel_Slide.Height >= panelHeight)
         {
             Timer_Panel.Stop();
             Hidden = false;
             this.Refresh();
         }
     }
 }
示例#6
0
        //para ocultar el panel
        internal void OcultarPanel()
        {
            if (Hidden == false)
            {
                // Hidden = true;
                Timer_Panel.Start();
                Panel_Slide.Height = Panel_Slide.Height - 10;

                if (Panel_Slide.Height <= 0)
                {
                    Timer_Panel.Stop();
                    Hidden = true;
                    this.Refresh();
                }
            }
        }