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

Handle Enter KeyPress

$
0
0

 

You will have to do some code to filter somewhere any way.

But you can stop the event from being raised by any key but the "ENTER" key this way

 

PublicClass Form1PrivateSub Form1_KeyPress(ByVal sender AsObject, ByVal e As System.Windows.Forms.KeyPressEventArgs) HandlesMe.KeyPress'this is raised only for the enter keyEndSubProtectedOverridesSub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)If e.KeyChar = Chr(Keys.Enter) ThenMyBase.OnKeyPress(e)EndSubEndClass

Viewing all articles
Browse latest Browse all 14

Trending Articles



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