数据窗口定义ue_key事件,event id 为 pbm_dwnkey
添加如下代码:
If KeyDown(KeyDownArrow!) And This.GetRow() <> This.RowCount() Then //下一行
This.SelectRow(0,False)
This.SetRow(GetRow())
This.SelectRow(GetRow() + 1,True)
End If
If KeyDown(KeyUpArrow!) And GetRow() <> 1 Then //上一行
This.SelectRow(0,False)
This.SetRow(GetRow())
This.SelectRow(GetRow() - 1,True)
End If
If KeyDown(KeyHome!) And RowCount() > 0 Then //第一行
This.SelectRow(0,False)
This.SetRow(1)
This.SelectRow(1,True)
End If
If KeyDown(KeyEnd!) And RowCount() > 0 Then //最后一行
This.SelectRow(0,False)
This.SetRow(RowCount())
This.SelectRow(RowCount(),True)
End If