开发者

How to Raise Keyboard Events for Special Characters/ Extended ASCII? (Visual Basic 6)

How to a raise a keypress event for Special Character for开发者_运维问答 typing extended ASCII Characters ?

Sample code snippet :

keybd_event vbKeyE, 0, KEYEVENTF_KEYDOWN, 0

Is there any alternative so that I can use KeyCode for Special character [ E.g. Chr$(122) ] instead of predefined and limited VbKeyA, VbKeyB, VbKeyC ..... etc ?

Waiting for your reply.

Regards,

Shankar


Here is an example that seems to cover your question:

Private Sub Text1_KeyPress (KeyAscii As Integer)
   If KeyAscii = 8 Then MsgBox "You pressed the BACKSPACE key."
End Sub

It was taken from here.


if keyascii=27 then
 if (msgbox"do you want to exit?",vbokcancel,"information")=vbok then 
end
end if
end if
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜