all groups > dotnet compact framework > october 2004 >
You're in the

dotnet compact framework

group:

"pressing" a button on an application



"pressing" a button on an application Peter Bliesner via .NET 247
10/31/2004 3:51:27 AM
dotnet compact framework: We have developed a application on a Symbol device using VB.net.compactframework. I there a way to use the enter key on the device to "press" a button control on the apllication?

--------------------------------
From: Peter Bliesner

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

RE: "pressing" a button on an application John Mankowski
10/31/2004 2:22:02 PM
[quoted text, click to view]
control on the apllication?

This technique is working for me. It's not very elegant but it does the job.
In the KeyDown method of each control on the form, add code to test if the
Enter key is pressed, then call the desired method. Here's the VB code.

Private Sub Textbox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txtSku.KeyDown
' if the enter key is pressed
If e.KeyCode() = Keys.Enter Then
' call a function to look up an item number
ItemLookup()
End If
End Sub
AddThis Social Bookmark Button