UCBtnFillet.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // ***********************************************************************
  2. // Assembly : HZH_Controls
  3. // Created : 08-08-2019
  4. //
  5. // ***********************************************************************
  6. // <copyright file="UCBtnFillet.cs">
  7. // Copyright by Huang Zhenghui(黄正辉) All, QQ group:568015492 QQ:623128629 Email:623128629@qq.com
  8. // </copyright>
  9. //
  10. // Blog: https://www.cnblogs.com/bfyx
  11. // GitHub:https://github.com/kwwwvagaa/NetWinformControl
  12. // gitee:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
  13. //
  14. // If you use this code, please keep this note.
  15. // ***********************************************************************
  16. using System;
  17. using System.Collections.Generic;
  18. using System.ComponentModel;
  19. using System.Drawing;
  20. using System.Data;
  21. using System.Linq;
  22. using System.Text;
  23. using System.Windows.Forms;
  24. namespace HZH_Controls.Controls
  25. {
  26. /// <summary>
  27. /// Class UCBtnFillet.
  28. /// Implements the <see cref="HZH_Controls.Controls.UCControlBase" />
  29. /// </summary>
  30. /// <seealso cref="HZH_Controls.Controls.UCControlBase" />
  31. [DefaultEvent("BtnClick")]
  32. public partial class UCBtnFillet : UCControlBase
  33. {
  34. /// <summary>
  35. /// 按钮点击事件
  36. /// </summary>
  37. [Description("按钮点击事件"), Category("自定义")]
  38. public event EventHandler BtnClick;
  39. /// <summary>
  40. /// 按钮图片
  41. /// </summary>
  42. /// <value>The BTN image.</value>
  43. [Description("按钮图片"), Category("自定义")]
  44. public Image BtnImage
  45. {
  46. get
  47. {
  48. return lbl.Image;
  49. }
  50. set
  51. {
  52. lbl.Image = value;
  53. }
  54. }
  55. /// <summary>
  56. /// 按钮文字
  57. /// </summary>
  58. /// <value>The BTN text.</value>
  59. [Description("按钮文字"), Category("自定义")]
  60. public string BtnText
  61. {
  62. get { return lbl.Text; }
  63. set
  64. {
  65. lbl.Text = value;
  66. }
  67. }
  68. /// <summary>
  69. /// Initializes a new instance of the <see cref="UCBtnFillet" /> class.
  70. /// </summary>
  71. public UCBtnFillet()
  72. {
  73. InitializeComponent();
  74. }
  75. /// <summary>
  76. /// Handles the MouseDown event of the lbl control.
  77. /// </summary>
  78. /// <param name="sender">The source of the event.</param>
  79. /// <param name="e">The <see cref="MouseEventArgs" /> instance containing the event data.</param>
  80. private void lbl_MouseDown(object sender, MouseEventArgs e)
  81. {
  82. if (BtnClick != null)
  83. BtnClick(this, e);
  84. }
  85. }
  86. }