Foxtable(狐表)用户栏目专家坐堂 → 请教,win8平板中,进入文本框时,如何自动调用系统软键盘


  共有4280人关注过本帖树形打印复制链接

主题:请教,win8平板中,进入文本框时,如何自动调用系统软键盘

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/7/18 9:30:00 [显示全部帖子]

 控制小键盘的方法

 

全局代码

 

Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
Public Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Integer, ByVal wMapType As Integer) As Integer

Public Const VK_NUMLOCK = &H90 ' Num Lock

Public Const KEYEVENTF_KEYDOWN = &H0 ' KeyDown

Public Const KEYEVENTF_KEYUP = &H2 ' KeyUp

 

 触发代码

 

Dim intScanCode As Integer = MapVirtualKey(VK_NUMLOCK, 0)

keybd_event(VK_NUMLOCK, intScanCode, KEYEVENTF_KEYDOWN, 0) ' 按下

keybd_event(VK_NUMLOCK, intScanCode, KEYEVENTF_KEYUP, 0) ' 放


 回到顶部