如何让DW在DDDW列按上下箭头跳行

PackChen 2017-06-30 06:01:48
如题,烦恼啊,老是处理不好
能不能让DDDW列按上下箭头是跳行而不是改变里面的值
...全文
886 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
PackChen 2017-08-12
  • 打赏
  • 举报
回复
引用 3 楼 yx812 的回复:
数据窗口定义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
不行的,dwnKey拦截不到箭头事件,被DDDW拦截掉了,Command和Other事件也不行,我原来不知道在这里还是在那个sybasebbs里面看到有人解决过,用另外的一个事件,但是我翻了一个星期都没有找到那篇文章了 不知道有什么办法
yx812 2017-07-17
  • 打赏
  • 举报
回复
数据窗口定义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
WorldMobile 2017-07-04
  • 打赏
  • 举报
回复
这个是datawindow数据窗口本身的效果,如果去掉的话,估计不能用上下键选择项目了,你在数据窗口里自定义个key事件,event id为pbm_dwnkey,然后在里面判断如果是按上下键的时候,就scrolltorow一行
PackChen 2017-07-04
  • 打赏
  • 举报
回复
引用 1 楼 lzp_lrp 的回复:
这个是datawindow数据窗口本身的效果,如果去掉的话,估计不能用上下键选择项目了,你在数据窗口里自定义个key事件,event id为pbm_dwnkey,然后在里面判断如果是按上下键的时候,就scrolltorow一行
不行的,dwnKey拦截不到箭头事件,被DDDW拦截掉了,Command和Other事件也不行,我原来不知道在这里还是在那个sybasebbs里面看到有人解决过,用另外的一个事件,但是我翻了一个星期都没有找到那篇文章了 不知道有什么办法

1,071

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧