Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 cusotm textbox key event?

$
0
0
Hello

anyone has seen this before
when you have a custom textbox and
the key event don't work

vb code Code:
  1. Private Sub OnBaseKeyDown(ByVal s As Object, ByVal e As KeyEventArgs)
  2.             If e.KeyCode = Keys.Enter Then
  3.                 ' SendKeys.Send("{ENTER}")
  4.                 e.SuppressKeyPress = True
  5.             End If
  6.            
  7.         End Sub


doesn't work even with the sendkeys the app freezes

code Code:
  1. Private Sub myTextBox1_KeyDown(ByVal sender As System.Object, _
  2.                                      ByVal e As System.Windows.Forms.KeyEventArgs) _
  3.                                      Handles mylTextBox1.KeyDown
  4.  
  5.               If e.KeyCode = Keys.Enter Then
  6.             MsgBox("Help")
  7.              End If
  8.  
  9.         End Sub


does nothing either.

does someone knows how to fix this please?

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>