Skip to content

Commit

Permalink
Del key for output window
Browse files Browse the repository at this point in the history
  • Loading branch information
conlooptechnologies committed Mar 13, 2019
1 parent 2c87eb2 commit f14ef6f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions instat/ucrOutputWindow.vb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ 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)
' MyBase.OnFormClosing(e)
' If Not e.Cancel AndAlso e.CloseReason = CloseReason.UserClosing Then
Expand Down Expand Up @@ -121,4 +131,6 @@ 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 f14ef6f

Please sign in to comment.