淘宝评价页面生成器:VB程序enter转TAB问题?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 14:19:30
在公共模块中放入下列代码:
public sub EnterToTab(Keyascii As Integer)
if Keyascii=13 then
SendKeys "{TAB}"
end if
end sub

为什么在其它窗体中没有响应呢??

把内容
if Keyascii=13 then
SendKeys "{TAB}"
end if
放在FORM_KEYDOWN事件裏。你这样单独写一个函数也可以,但也要在KEYDOWN裏调这个EnterToTab函数,所以这样没什麽必要。