mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Support CTRL+A in OCR results window
Also, sets the focus to the result textbox upon completion (which will also selct all of the text) Closes #2852
This commit is contained in:
parent
b3640f6f88
commit
6f4854b468
2 changed files with 13 additions and 0 deletions
|
@ -67,6 +67,7 @@ private void InitializeComponent()
|
|||
this.txtResult.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.txtResult.Size = new System.Drawing.Size(544, 368);
|
||||
this.txtResult.TabIndex = 2;
|
||||
this.txtResult.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtResult_KeyDown);
|
||||
//
|
||||
// lblResult
|
||||
//
|
||||
|
|
|
@ -105,6 +105,7 @@ private void StartOCR(Stream stream, string filename)
|
|||
UpdateControls();
|
||||
cbLanguages.Enabled = btnStartOCR.Enabled = txtResult.Enabled = true;
|
||||
pbProgress.Visible = false;
|
||||
txtResult.Focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -124,5 +125,16 @@ private void llAttribution_LinkClicked(object sender, LinkLabelLinkClickedEventA
|
|||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue