DS-DIGIT-webfontLable2.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace IntelligentControlForsx.MyControls
  11. {
  12. public partial class DS_DIGIT_webfontLable2 : UserControl
  13. {
  14. public DS_DIGIT_webfontLable2()
  15. {
  16. InitializeComponent();
  17. this.label1.Font = new System.Drawing.Font("DS-Digital", 13F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  18. this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
  19. }
  20. [Browsable(true), Category("Appearance")]
  21. public string LableText
  22. {
  23. get { return this.label1.Text; }
  24. set { this.label1.Text = value; }
  25. }
  26. [Browsable(true), Category("Appearance")]
  27. public float LableFontSize
  28. {
  29. get { return this.label1.Font.Size; }
  30. set { this.label1.Font = new System.Drawing.Font("DS-Digital", value, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); }
  31. }
  32. public event EventHandler MyClick;
  33. private void label1_Click(object sender, EventArgs e)
  34. {
  35. MessageBox.Show("Lable");
  36. if (MyClick != null)
  37. {
  38. MyClick(this, e);
  39. }
  40. }
  41. private void label1_MouseEnter(object sender, EventArgs e)
  42. {
  43. this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
  44. }
  45. private void label1_MouseLeave(object sender, EventArgs e)
  46. {
  47. this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
  48. }
  49. }
  50. }