Quantcast
Channel: Handle Enter KeyPress
Viewing all articles
Browse latest Browse all 14

Handle Enter KeyPress

$
0
0

I am using the Event Handler below for the Enter Key Press Event, it is running when ever enny of the keys is pressed.  This is not so much a problem when the app. is runing, unnesasirry yes.  It is giving me problems when ever I am Debuging using Brakepoints.

How can I change the Handler so it only runs when the Enter Key is Presseed, doing away with the If statment?

 

Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
     
        If e.KeyChar = Chr(Keys.Enter) Then
      
'Diferent code blocks will run here depending on what
'TextBox or Label is selected.

       End If

    End Sub


Viewing all articles
Browse latest Browse all 14

Trending Articles



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