private void PanelTimer2_Tick(object sender, EventArgs e) { if (isHide) { Panel.Location = new Point(Panel.Location.X - 5, Panel.Location.Y); if (Panel.Location.X <= 500) { PanelButton.Text = ">"; PanelTimer2.Stop(); isHide = false; this.Refresh(); } } else { Panel.Location = new Point(Panel.Location.X + 5, Panel.Location.Y); if (Panel.Location.X >= 1000) { PanelButton.Text = "<"; PanelTimer2.Stop(); isHide = true; this.Refresh(); } } }
private void button1_Click(object sender, EventArgs e) { PanelTimer2.Start(); }