先编辑控件的TabOrder顺序,然后在 global external functions 中定义一个API:
Subroutine keybd_event(int bVk,int bScan,ulong dwFlags,ulong dwExtraInfo) LIBRARY "user32.dll"
在窗口的key()事件中写如下代码:
If key = KeyEnter! Or Key = KeyRightArrow! Then
keybd_event( 9,0,0,0 ) // 按下tab
keybd_event( 9,0,2,0 ) // 释放tab
Return 1
End If
If Key = KeyleftArrow! Then
keybd_event( 16,0,0,0 ) // 按下shift
keybd_event( 9,0,0,0 ) // 按下tab
keybd_event( 9,0,2,0 ) // 释放tab
keybd_event( 16,0,2,0 ) // 释放shift
Return 1
End If
原文地址:http://www.cnblogs.com/diyishijian/p/3998928.html