Ok a simple question how to bind a command button to enter?
Last edited by n00b scripter; Jun 20th, 2005 at 02:43 PM.
Set its 'default' property to TRUE
Or do it programmatically: VB Code: 'method 1 Private Sub Form_Load() Me.KeyPreview = True End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) If Shift = 0 And KeyCode = 13 Then Command1_Click End If End Sub 'OR 'method 2 Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Command1_Click End If End Sub
'method 1 Private Sub Form_Load() Me.KeyPreview = True End Sub Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) If Shift = 0 And KeyCode = 13 Then Command1_Click End If End Sub 'OR 'method 2 Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Command1_Click End If End Sub
Thx guys that helped
Forum Rules