在鼠标单击事件里判断用户是否按下了shift键,然后写个循环语句就行了。
Event Clicked:
Long ll_row,ll_loop
IF KeyDown(KeyShift!) THEN
ll_row = This.GetSelectedRow()
IF ll_row < row THEN
For ll_loop = ll_row + 1 To row
This.SelectRow(ll_loop,True)
Next
ELSE
For ll_loop = row To ll_row - 1
This.SelectRow(ll_loop,True)
Next
END IF
long lrow,lstartrow,lendrow
if keydown(keycontrol!) then
if row>0 then
this.selectrow(row,true)
else
return
end if
elseif keydown(keyshift!) then
this.setredraw(false)
lstartrow=this.getrow()
lendrow=row
if lstartrow()>lendrow then
for lrow=lstartrow to lendrow step -1
this.selectrow(lrow,true)
next
else
for lrow=lstartrow to lendrow
this.selectrow(lrow,true)
next
end if
this.setredraw(true)
else
this.selectrow(0,false)
this.selectrow(row,true)
end if