ButtonUpperArrow.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Windows.Forms;
  5. using System.IO;
  6. using System.Drawing;
  7. using System.Drawing.Drawing2D;
  8. using System.ComponentModel;
  9. namespace LYFZ.ComponentLibrary
  10. {
  11. public class ButtonUpperArrow:ButtonExpand
  12. {
  13. public ButtonUpperArrow()
  14. : base(LYFZ.ComponentLibrary.GetUIResources.btn_UP)
  15. {
  16. this.BackImg = LYFZ.ComponentLibrary.GetUIResources.btn_UP;
  17. this.IsShowText = false;
  18. this.Width = 26;
  19. this.Height = 26;
  20. this.Click += ButtonUpperArrow_Click;
  21. }
  22. void ButtonUpperArrow_Click(object sender, EventArgs e)
  23. {
  24. IsCustomBackImg = true;
  25. if (IsDown)
  26. {
  27. this.BackImg = LYFZ.ComponentLibrary.GetUIResources.btn_down;
  28. }
  29. else
  30. {
  31. this.BackImg = LYFZ.ComponentLibrary.GetUIResources.btn_UP;
  32. }
  33. }
  34. bool isDown = false;
  35. [DescriptionAttribute("设置方向"), CategoryAttribute("组件扩展属性")]
  36. public bool IsDown
  37. {
  38. get { return isDown; }
  39. set
  40. {
  41. isDown = value;
  42. ButtonUpperArrow_Click(null, null);
  43. Invalidate(false);
  44. }
  45. }
  46. }
  47. }