title image


Smiley TIPP: Einfügetaste für ein Formularfeld abschalten
Ach so "Einfügetaste" - hab ich nicht richtig gelesen...



Das geht so:



Private Declare Function GetKeyboardState Lib "user32" _

(pbKeyState As Byte) As Long

Private Declare Function SetKeyboardState Lib "user32" _

(lppbKeyState As Byte) As Long

Private Const VK_INSERT = &H2D

Private keys(255) As Byte



Private Sub DeinFeld_Enter()

Dim I As Long

For I = 0 To 255: keys(I) = 0: Next I

GetKeyboardState keys(0)

keys(VK_INSERT) = 0

SetKeyboardState keys(0)

End Sub



Private Sub DeinFeld_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = 45 Then KeyCode = 0

End Sub



Private Sub Form_Load()

Me.KeyPreview = False

End Sub





Wenn's für das ganze Formular gelten soll:



Private Declare Function GetKeyboardState Lib "user32" _

(pbKeyState As Byte) As Long

Private Declare Function SetKeyboardState Lib "user32" _

(lppbKeyState As Byte) As Long

Private Const VK_INSERT = &H2D

Private keys(255) As Byte



Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = 45 Then KeyCode = 0

End Sub



Private Sub Form_Load()

Dim I As Long

For I = 0 To 255: keys(I) = 0: Next I

GetKeyboardState keys(0)

keys(VK_INSERT) = 0

SetKeyboardState keys(0)

Me.KeyPreview = True

End Sub



Gruß aus dem Norden
Reinhard


Bitte immer die Access-Version angeben!
DB-Wiki


Wie man Fragen richtig stellt

YaccessAccess-FAQUnd ansonsten: Wikipedia




geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: