ButtonDownArrow.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 ButtonDownArrow:ButtonExpand
  12. {
  13. public ButtonDownArrow()
  14. : base(LYFZ.ComponentLibrary.GetUIResources.btn_down)
  15. {
  16. this.BackImg = LYFZ.ComponentLibrary.GetUIResources.btn_down;
  17. this.IsShowText = false;
  18. this.Width = 26;
  19. this.Height = 26;
  20. this.Click += ButtonDownArrow_Click;
  21. }
  22. void ButtonDownArrow_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. this.BackImg = LYFZ.ComponentLibrary.GetUIResources.btn_UP;
  31. }
  32. }
  33. bool isDown = true;
  34. [DescriptionAttribute("设置方向"), CategoryAttribute("组件扩展属性")]
  35. public bool IsDown
  36. {
  37. get { return isDown; }
  38. set
  39. {
  40. isDown = value;
  41. ButtonDownArrow_Click(null, null);
  42. Invalidate(false); }
  43. }
  44. }
  45. }