【发布时间】:2020-01-22 07:38:52
【问题描述】:
所以我正在处理的 VB6 项目中有 FlexGrid。它在每一行都有名称,我有一个下拉菜单,因此用户可以选择他们想要查看更多信息的名称,这就是我所拥有的。
Dim target_name As String
Dim r As Integer
' Get the name.
target_name = Combo1
If Len(target_name) = 0 Then Exit Sub
' Search for the name, skipping the column heading row.
target_name = LCase$(target_name)
For r = 1 To MSFlexGrid1.Rows - 1
If LCase$(MSFlexGrid1.TextMatrix(r, 0)) = _
target_name Then
' We found the target. Select this row.
MSFlexGrid1.Row = r
MSFlexGrid1.RowSel = r
MSFlexGrid1.Col = 0
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
' Make the row visible.
MSFlexGrid1.TopRow = r
Exit Sub
End If
Next r
效果很好,但它也显示了该名称下方的所有内容,我希望它仅突出所选名称。 任何帮助都会很棒。
【问题讨论】:
标签: vb6 msflexgrid