Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#5246 from Patowhiz/OutputWindowDel
Browse files Browse the repository at this point in the history
Delete Selection on Delete Key Press Output window
  • Loading branch information
dannyparsons authored May 8, 2019
2 parents e98d738 + 9bf7ba4 commit 3bc745a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions instat/ucrOutputWindow.vb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ Public Class ucrOutputWindow
'TEST temporary
Private Sub ucrOutputWindow_Load(sender As Object, e As EventArgs) Handles Me.Load
autoTranslate(Me)
'for some reason the normal KeyDown event is not raised when del key is pressed
'probably because the del is not recognised as an inputkey to ucrRichTextBox
AddHandler ucrRichTextBox.PreviewKeyDown, AddressOf ucrRichTextBox_KeyDownEventHandler
End Sub

Private Sub ucrRichTextBox_KeyDownEventHandler(sender As Object, e As EventArgs)
'if its a delete key then delete the selection
If DirectCast(e, System.Windows.Input.KeyEventArgs).Key = System.Windows.Input.Key.Delete Then
ucrRichTextBox.rtbOutput.Selection.Text = ""
End If
End Sub

'Protected Overrides Sub OnFormClosing(ByVal e As FormClosingEventArgs)
Expand Down Expand Up @@ -121,4 +130,5 @@ Public Class ucrOutputWindow
Private Sub HelpRTB_Click(sender As Object, e As EventArgs) Handles HelpRTB.Click
Help.ShowHelp(Me, frmMain.strStaticPath & "\" & frmMain.strHelpFilePath, HelpNavigator.TopicId, "540")
End Sub

End Class

0 comments on commit 3bc745a

Please sign in to comment.