UCProduct.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace HRT_Measure
  11. {
  12. public partial class UCProduct : UserControl
  13. {
  14. public UCProduct()
  15. {
  16. InitializeComponent();
  17. }
  18. public string DisplayLabel
  19. {
  20. set { grbProduct.Text = value; }
  21. }
  22. private void UCProduct_Load(object sender, EventArgs e)
  23. {
  24. this.Dock = DockStyle.Fill;
  25. //lblThickness.Location = new Point(grbProduct.Width / 8, grbProduct.Height / 4);
  26. //lblThicknessResult.Location = new Point(lblThickness.Left, grbProduct.Height / 2);
  27. //lblFlatness.Location = new Point(grbProduct.Width * 2 / 5, grbProduct.Height / 4);
  28. //lblFlatness.Location = new Point(lblFlatness.Left, grbProduct.Height / 2);
  29. //lblHeight.Location = new Point(grbProduct.Width * 2 / 3, grbProduct.Height / 4);
  30. //lblHeightResult.Location = new Point(lblHeight.Left, grbProduct.Height / 2);
  31. }
  32. public void DisplayResult(bool isThickness,bool isFlatness,bool isHeight,bool isDiff)
  33. {
  34. this.Invoke(new Action(() =>
  35. {
  36. lblThicknessResult.Text = isThickness ? "PASS" : "NG";
  37. lblThicknessResult.ForeColor = isThickness ? Color.Lime : Color.Red;
  38. lblFlatnessResult.Text = isFlatness ? "PASS" : "NG";
  39. lblFlatnessResult.ForeColor = isFlatness ? Color.Lime : Color.Red;
  40. lblHeightResult.Text = isHeight ? "PASS" : "NG";
  41. lblHeightResult.ForeColor = isHeight ? Color.Lime : Color.Red;
  42. lblDiffResult.Text = isDiff ? "PASS" : "NG";
  43. lblDiffResult.ForeColor = isDiff ? Color.Lime : Color.Red;
  44. }));
  45. }
  46. private void grbProduct_Click(object sender, EventArgs e)
  47. {
  48. }
  49. }
  50. }