Enter key press event show how VB 6.0 vs VB.NET 2005 ????

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
How I can hook on my entery tool forms when user press ENTER key to go on next Control which can be any dot.net control which is indexed by TabIndex?
My client dont like to use TAB key to jump on next control, they like ENTER as well and we need to refactory all VB 6.0 projects in VB.NET 2005...
<font face="Tahoma,Helvetica,Sans-Serif In VB 6.0 you would do something like this:</font>
<font face="Courier New, Courier, Monospace Private Sub txtField_KeyPress(Index As Integer, KeyAscii As Integer)
   
    If KeyAscii = vbKeyReturn Then</font>
<font face="Courier New, Courier, Monospace </font> 
<font face="Courier New, Courier, Monospace         KeyAscii = 0
        SendKeys "{TAB}"
   
    End If
   
End Sub
</font><font face="Courier New, Courier, Monospace <font face="Tahoma,Helvetica,Sans-Serif </font></font>
<font face="Courier New, Courier, Monospace <font face="Tahoma,Helvetica,Sans-Serif Of course above pice of code is just sample code how this is working in VB 6.0... </font></font>
 
<font face="Courier New, Courier, Monospace <font face=Tahoma>How I can do something like this in VB.NET 2005?</font></font>

View the full article
 
Back
Top