Merge pull request #2868 from campbeb/issue2852

Support CTRL+A in OCR results window
This commit is contained in:
Jaex 2017-10-21 05:48:03 +03:00 committed by GitHub
commit ec03407647
2 changed files with 13 additions and 0 deletions

View file

@ -67,6 +67,7 @@ private void InitializeComponent()
this.txtResult.ScrollBars = System.Windows.Forms.ScrollBars.Both; this.txtResult.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtResult.Size = new System.Drawing.Size(544, 368); this.txtResult.Size = new System.Drawing.Size(544, 368);
this.txtResult.TabIndex = 2; this.txtResult.TabIndex = 2;
this.txtResult.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtResult_KeyDown);
// //
// lblResult // lblResult
// //

View file

@ -105,6 +105,7 @@ private void StartOCR(Stream stream, string filename)
UpdateControls(); UpdateControls();
cbLanguages.Enabled = btnStartOCR.Enabled = txtResult.Enabled = true; cbLanguages.Enabled = btnStartOCR.Enabled = txtResult.Enabled = true;
pbProgress.Visible = false; pbProgress.Visible = false;
txtResult.Focus();
} }
}); });
} }
@ -124,5 +125,16 @@ private void llAttribution_LinkClicked(object sender, LinkLabelLinkClickedEventA
{ {
URLHelpers.OpenURL("https://ocr.space"); URLHelpers.OpenURL("https://ocr.space");
} }
private void txtResult_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.A)
{
if (sender != null)
((TextBox)sender).SelectAll();
e.SuppressKeyPress = true; // TextBox will beep if it gets the CTRL+A
e.Handled = true;
}
}
} }
} }