using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HRT_Measure { public partial class UCProduct : UserControl { public UCProduct() { InitializeComponent(); } public string DisplayLabel { set { grbProduct.Text = value; } } private void UCProduct_Load(object sender, EventArgs e) { this.Dock = DockStyle.Fill; //lblThickness.Location = new Point(grbProduct.Width / 8, grbProduct.Height / 4); //lblThicknessResult.Location = new Point(lblThickness.Left, grbProduct.Height / 2); //lblFlatness.Location = new Point(grbProduct.Width * 2 / 5, grbProduct.Height / 4); //lblFlatness.Location = new Point(lblFlatness.Left, grbProduct.Height / 2); //lblHeight.Location = new Point(grbProduct.Width * 2 / 3, grbProduct.Height / 4); //lblHeightResult.Location = new Point(lblHeight.Left, grbProduct.Height / 2); } public void DisplayResult(bool isThickness,bool isFlatness,bool isHeight,bool isDiff) { this.Invoke(new Action(() => { lblThicknessResult.Text = isThickness ? "PASS" : "NG"; lblThicknessResult.ForeColor = isThickness ? Color.Lime : Color.Red; lblFlatnessResult.Text = isFlatness ? "PASS" : "NG"; lblFlatnessResult.ForeColor = isFlatness ? Color.Lime : Color.Red; lblHeightResult.Text = isHeight ? "PASS" : "NG"; lblHeightResult.ForeColor = isHeight ? Color.Lime : Color.Red; lblDiffResult.Text = isDiff ? "PASS" : "NG"; lblDiffResult.ForeColor = isDiff ? Color.Lime : Color.Red; })); } private void grbProduct_Click(object sender, EventArgs e) { } } }