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

How do I detect a key press at run time ?

$
0
0
Hi, I'm trying to detect a 'Return' key press but can't find how to do that.

Reading a character typed into a Textbox is simple, but I can't detect the 'Enter' key.

I tried to detect it at any time, couldn't do that, so I tried to catch Any character, not specifically typed into anywhere... Can't even manage that !

Code:

Private Sub Key_Data(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress

        Dim z As String = e.KeyChar.ToString

    End Sub

This runs ok, but doesn't actually catch anything !


Poppa.

Viewing all articles
Browse latest Browse all 27554

Trending Articles



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