From dac3e12cc046aabeefd828b3f03794fe2bc0ba06 Mon Sep 17 00:00:00 2001 From: wells.liu <wells.liu@broconcentric.com> Date: 星期四, 09 七月 2020 09:54:26 +0800 Subject: [PATCH] Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071 --- src/Bro.M071.Process/UI/M071_MainForm.cs | 29 ++++++++++++++++++++++++++++- 1 files changed, 28 insertions(+), 1 deletions(-) diff --git a/src/Bro.M071.Process/UI/M071_MainForm.cs b/src/Bro.M071.Process/UI/M071_MainForm.cs index 8623ac8..df918c4 100644 --- a/src/Bro.M071.Process/UI/M071_MainForm.cs +++ b/src/Bro.M071.Process/UI/M071_MainForm.cs @@ -32,6 +32,13 @@ plImage.Controls.Add(cvImage); tscEditLocation.Visible = tsmiShowEditor.Checked = false; + + this.Load += async (s, e) => + { + await Task.Delay(300); + + cvImage.SetScreenSize(); + }; } public override void OnProcessUpdated() @@ -48,6 +55,7 @@ { Bitmap image = (Bitmap)Image.FromFile(Config.BackgroundImagePath); cvImage.LoadImage(image); + cvImage.SetScreenSize(); } catch (Exception ex) { @@ -70,7 +78,8 @@ lvMeasures.Items.Add(item); }); - txtBarcode.ReadOnly = Config.IsBarcodeManulInputBlocked; + if (txtBarcode.IsHandleCreated) + txtBarcode.BeginInvoke(new Action(() => txtBarcode.ReadOnly = Config.IsBarcodeManulInputBlocked)); Process_M071.OnClearBarcode -= M071_MainForm_OnClearBarcode; Process_M071.OnClearBarcode += M071_MainForm_OnClearBarcode; @@ -150,6 +159,19 @@ MessageBox.Show("鏍囩淇敼瀹屾垚"); } + + private void lvMeasures_DoubleClick(object sender, EventArgs e) + { + if (lvMeasures.SelectedItems.Count <= 0) + return; + + var ele = cvImage.Elements.FirstOrDefault(u => u.ID == lvMeasures.SelectedItems[0].Tag.ToString()); + if (ele != null) + { + ele.State = ElementState.Selected; + cvImage.Invalidate(); + } + } #endregion #region 涓婃柟鐘舵�佸尯 @@ -169,6 +191,11 @@ txtBarcode.Text = _barcode; _barcode = ""; } + + if (e.KeyValue == 27) + { + cvImage.Elements.ToList().ForEach(ele => ele.State = ElementState.Normal); + } } private void txtBarcode_TextChanged(object sender, EventArgs e) -- Gitblit v1.8.0