LklLinkLabel.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. 
  2. using System.ComponentModel;
  3. using System.Drawing;
  4. using System.Windows.Forms;
  5. namespace Dongke.WinForm.Controls
  6. {
  7. /// <summary>
  8. /// 可显示超链接的标签控件
  9. /// </summary>
  10. [ToolboxBitmap(typeof(LinkLabel))]
  11. public class LklLinkLabel : LinkLabel, IDKControl, IAsyncControl
  12. {
  13. #region 构造函数
  14. /// <summary>
  15. /// 可显示超链接的标签控件
  16. /// </summary>
  17. public LklLinkLabel()
  18. {
  19. base.BackColor = Color.Transparent;
  20. }
  21. #endregion
  22. #region 重写属性
  23. /// <summary>
  24. /// 获取或设置一个值,该值指示是否自动调整控件的大小以完整显示其内容
  25. /// </summary>
  26. [DefaultValue(true)]
  27. public override bool AutoSize
  28. {
  29. get
  30. {
  31. return base.AutoSize;
  32. }
  33. set
  34. {
  35. base.AutoSize = value;
  36. }
  37. }
  38. /// <summary>
  39. /// 获取或设置控件的背景色
  40. /// </summary>
  41. [DefaultValue(typeof(Color), "Transparent")]
  42. public override Color BackColor
  43. {
  44. get
  45. {
  46. return base.BackColor;
  47. }
  48. set
  49. {
  50. base.BackColor = value;
  51. }
  52. }
  53. #endregion
  54. #region IAsyncControl 成员
  55. /// <summary>
  56. /// 开始异步处理
  57. /// </summary>
  58. /// <param name="doFocus">是否处理焦点</param>
  59. public virtual void BeginAsync(ref bool doFocus)
  60. {
  61. this.Enabled = false;
  62. }
  63. /// <summary>
  64. /// 结束异步处理
  65. /// </summary>
  66. public virtual void EndAsync()
  67. {
  68. }
  69. #endregion
  70. }
  71. }