public Form_Principal() { InitializeComponent(); panelHeight = Panel_Slide.Height; Hidden = false; Panel_Slide.Visible = false; Timer_Panel.Start(); }
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(); } }
//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(); } } }
//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(); } } }