MSHFlexGrid选中行变色问题
选中行变色的关键语句:
Private Sub MSHFlexGrid1_RowColChange()
With MSHFlexGrid1
.Col = 1
.SelectionMode = flexSelectionByRow
.FocusRect = flexFocusHeavy
.HighLight = flexHighlightWithFocus
End With
End Sub
问题提出:
采用数据记录集方式
Set MSHFlexGrid1.DataSource = rst
点击选中行,上述关键语句不起作用,选中行不变色。
采用TextMatrix属性赋值,上述关键语句起作用,选中行变兰色。
With MSHFlexGrid1
For i = 1 To .Rows - 1
For j = 1 To 4
If j Mod 2 = 0 Then
.TextMatrix(i, j) = Int((100 * Rnd) + 1)
Else
.TextMatrix(i, j) = "b "
End If
Next j
Next i
请教各位大侠,问题出在哪?
理论上是可行的,实际操作就是有问题,问题倒底出在哪里.
[解决办法]
Set MSHFlexGrid1.DataSource = rst
点击选中行,上述关键语句不起作用,选中行不变色。————
把Private Sub MSHFlexGrid1_RowColChange()里的语句添加到
MSHFlexGrid1_Click()函数
里