if key = KeyLeftArrow! then
keybd_event(VK_SHIFT,0,0,0) //按下shift
keybd_event(VK_TAB,0,0,0) //按下tab
keybd_event(VK_TAB,0,2,0) //释放tab
keybd_event(VK_SHIFT,0,2,0) //释放shift
return 1
end if
if key = KeyRightArrow! then
keybd_event(VK_TAB,0,0,0) //按下tab
keybd_event(VK_TAB,0,2,0) //释放tab
return 1
end if
2.定义第二个用户自定义事件,ue_pressenter,Event ID:pbm_dwnkey
脚本为:
If This.Accepttext()<0 then
return
end if
if This.getcolumn()=Long(This.Describe("Datawindow.Column.count")) then
if this.getrow()=This.Rowcount() then
This.insertrow(0)
This.scrolltorow(This.getrow()+1)
This.Setcolumn(1)
return
end if
end if
send(Handle(this),256,9,long(0,0))
This.SetActionCode(1)
This.settransobject(sqlca)
通过以上这样的方法即可实现您的要求。当然,你也可以创建一个用户对象,将这
个事件写在其中,可以在任何需要使用此功能的窗口中都可以实现。
如果您对以上回答有什么意见,请留言给我或者mail给我哦!
if key = KeyLeftArrow! then
keybd_event(VK_SHIFT,0,0,0) //按下shift
keybd_event(VK_TAB,0,0,0) //按下tab
keybd_event(VK_TAB,0,2,0) //释放tab
keybd_event(VK_SHIFT,0,2,0) //释放shift
return 1
end if
if key = KeyRightArrow! then
keybd_event(VK_TAB,0,0,0) //按下tab
keybd_event(VK_TAB,0,2,0) //释放tab
return 1
end if
1.定义第二个用户自定义事件,ue_pressenter,Event ID:pbm_dwnkey
脚本为:
If This.Accepttext()<0 then
return
end if
if This.getcolumn()=Long(This.Describe("Datawindow.Column.count")) then
if this.getrow()=This.Rowcount() then
This.insertrow(0)
This.scrolltorow(This.getrow()+1)
This.Setcolumn(1)
return
end if
end if
send(Handle(this),256,9,long(0,0))
This.SetActionCode(1)
This.settransobject(sqlca)
通过以上这样的方法即可实现您的要求。当然,你也可以创建一个用户对象,将这
个事件写在其中,可以在任何需要使用此功能的窗口中都可以实现。
case KeyEnter!
Send( Handle(m_dw), 256, 9, keyflags )
CASE KeyTab!
m_dw.Post Function ScrollToRow(m_dw.GetRow())
if KeyFlags=1 then
m_dw.Post Function SetFocus()
end if