12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace SkypeDemo
- {
- public partial class Form1 : Form
- {
- int panelWidth;
- bool Hidden;
- public Form1()
- {
- InitializeComponent();
- panelWidth = PanelSlide.Width;
- Hidden = false;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- timer1.Start();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- if (Hidden)
- {
- PanelSlide.Width = PanelSlide.Width + 10;
- if (PanelSlide.Width >= panelWidth)
- {
- timer1.Stop();
- Hidden = false;
- this.Refresh();
- }
- }
- else
- {
- PanelSlide.Width = PanelSlide.Width - 10;
- if (PanelSlide.Width <= 0)
- {
- timer1.Stop();
- Hidden = true;
- this.Refresh();
- }
- }
- }
- private void button7_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- }
- }
|