首页 > 开发 > Flex > 正文

MSHFlexGrid1使用技巧(一)[如何让MSHFlexGrid只能被选中一行]

2024-07-21 02:16:24
字体:
来源:转载
供稿:网友
mshflexgrid控件点击时可以选中多行,但有时我们需要仅仅选中一行,有一个小技巧:



option explicit
dim currentrow as integer
private sub form_load()
dim i as integer, j as integer
with mshflexgrid1
.rows = 10
.cols = 4
for i = 1 to 9
.textmatrix(i, 0) = "第 " & i & " 行"
for j = 1 to 3
.textmatrix(0, j) = "第 " & j & " 列"
.textmatrix(i, j) = i & "," & j
next
next
end with
end sub
private sub mshflexgrid1_mousedown(button as integer, shift as integer, x as single, y as single)
with mshflexgrid1
.row = .mouserow
currentrow = .row
.col = 0
.colsel = .cols - 1
end with
end sub
private sub mshflexgrid1_mouseup(button as integer, shift as integer, x as single, y as single)
with mshflexgrid1
.rowsel = currentrow
.colsel = .cols - 1
end with
end sub

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表