LabelCheckBox.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.Windows.Forms;
  9. namespace Core.Mes.Client.Comm.Control
  10. {
  11. /// <summary>
  12. /// 主要用于FlowLayoutPanel
  13. /// </summary>
  14. public partial class LabelCheckBox : UserControl, LabelControlInterface
  15. {
  16. public LabelCheckBox()
  17. {
  18. InitializeComponent();
  19. }
  20. [Browsable(true), Category("原始系统控件")]
  21. [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
  22. public CheckBox CheckBox
  23. {
  24. get
  25. {
  26. return this.checkBox1;
  27. }
  28. }
  29. [Browsable(true), Category("外观")]
  30. [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
  31. public bool Checked
  32. {
  33. get
  34. {
  35. return this.checkBox1.Checked;
  36. }
  37. set
  38. {
  39. this.checkBox1.Checked = value;
  40. }
  41. }
  42. [Browsable(true), Category("外观")]
  43. [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
  44. public string Caption
  45. {
  46. get
  47. {
  48. return this.checkBox1.Text;
  49. }
  50. set
  51. {
  52. this.checkBox1.Text = value;
  53. }
  54. }
  55. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  56. {
  57. if (DataBindings["Checked"] != null)
  58. {
  59. DataBindings["Checked"].WriteValue();
  60. }
  61. }
  62. }
  63. }