您的位置:首页 > 其它

在pb数据窗口实现选中多行数据

2011-02-25 16:37 232 查看
long l_lastrow=1 //声明实例变量并置初值(上次点击行)
datawindow的click事件代码:
long i
if keydown(keyshift!) then //如果按下Shift键
if row>l_lastrow then
for i=l_lastrow to row
this.selectrow(i,true) //选中当前行和上次单击行之间的所有数据行
next
else
for i=l_lastrow to row step -1
this.selectrow(i,true) //选中当前行和上次单击行之间的所有数据行
next
end if
elseif keydown(keycontrol!) then //如果按下Ctrl键
if this.isselected(row) then //如果当前行被选中
this.selectrow(row,false) //取消选中该行
else
this.selectrow(row,true) //选中该行
end if
else //没有功能键按下
for i=1 to this.rowcount()
this.selectrow(i,false) //取消所有数据行选中
next
l_lastrow=row //将当前行号赋给实例变量l_lastrow
this.selectrow(row,true) //选中当前行
end if
http://hi.baidu.com/jiaxw/blog/item/b158d31f38107bf2e0fe0b92.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: