private void SlidingPanel_Timer_Tick(object sender, EventArgs e) { if (isSlidingPanelExpanded) { //retract Panel SlidingPanel.Width -= 30; if (SlidingPanel.Width <= MinSliderWidth) { isSlidingPanelExpanded = false; SlidingPanel_Timer.Stop(); retractSlidingPanelGUI(); this.Refresh(); } } else { //Expand the sliding panel SlidingPanel.Width += 30; if (SlidingPanel.Width >= MaxSliderWidth) { //stop expanding isSlidingPanelExpanded = true; SlidingPanel_Timer.Stop(); expandSlidingPanelGUI(); this.Refresh(); } } }
private void SlidingPanel_Timer_Tick(object sender, EventArgs e) { if (isSlidingPanelExpanded) { //retract SlidingPanel.Height -= 30; if (SlidingPanel.Height <= MinSliderHeight) { //stop retract isSlidingPanelExpanded = false; SlidingPanel_Timer.Stop(); this.Refresh(); } } else { //expand the panel SlidingPanel.Height += 30; if (SlidingPanel.Height >= MaxSliderHeight) { //stop expand isSlidingPanelExpanded = true; SlidingPanel_Timer.Stop(); this.Refresh(); } } }