Form1.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace SkypeDemo
  11. {
  12. public partial class Form1 : Form
  13. {
  14. int panelWidth;
  15. bool Hidden;
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. panelWidth = PanelSlide.Width;
  20. Hidden = false;
  21. }
  22. private void button1_Click(object sender, EventArgs e)
  23. {
  24. timer1.Start();
  25. }
  26. private void timer1_Tick(object sender, EventArgs e)
  27. {
  28. if (Hidden)
  29. {
  30. PanelSlide.Width = PanelSlide.Width + 10;
  31. if (PanelSlide.Width >= panelWidth)
  32. {
  33. timer1.Stop();
  34. Hidden = false;
  35. this.Refresh();
  36. }
  37. }
  38. else
  39. {
  40. PanelSlide.Width = PanelSlide.Width - 10;
  41. if (PanelSlide.Width <= 0)
  42. {
  43. timer1.Stop();
  44. Hidden = true;
  45. this.Refresh();
  46. }
  47. }
  48. }
  49. private void button7_Click(object sender, EventArgs e)
  50. {
  51. Application.Exit();
  52. }
  53. }
  54. }