Tastatur-Ereignis bei einem Formular

KeyPreview-Eigenschaft
Private Sub chkKeyPreview_Click()
   Me.KeyPreview = CBool(chkKeyPreview.Value)
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer) Wird die CheckBox "KeyPreview=True" markiert, erhält
   MsgBox Prompt:="KeyPress beim Formular", _ das Formular den ersten Fokus, wenn man mit der
   Title:="KeyPress-Ereignis" Tastatur arbeitet.
End Sub
Private Sub txtTextfeld1_KeyPress(KeyAscii As Integer)
   MsgBox Prompt:="KeyPress bei Textfeld1", Title:="KeyPress-Ereignis"
End Sub
Private Sub txtTextfeld2_KeyPress(KeyAscii As Integer)
   MsgBox Prompt:="KeyPress bei Textfeld2", Title:="KeyPress-Ereignis"
End Sub

 Ranking-Hits zurück Sitemap
Designed by www.wbrnet.info