Private Sub hflexgrid_EnterCell()
'单击某一单元时,改变该行颜色
Dim i_Col As Integer
Dim c_col As Integer
c_col = Hflexgrid.Col
If c_col > 0 Then
For i_Col = 0 To Hflexgrid.Cols - 1
Hflexgrid.Col = i_Col
Hflexgrid.CellBackColor = vbgreen
Next i_Col
Hflexgrid.Col = c_col
End If
End Sub
Private Sub hflexgrid_LeaveCell()
'当某一行失去焦点时,改变成默认颜色
Dim i_Col As Integer
Dim c_col As Integer
c_col = Hflexgrid.Col
For i_Col = 0 To Hflexgrid.Cols - 1
Hflexgrid.Col = i_Col
Hflexgrid.CellBackColor = vbWhite
Next i_Col
Hflexgrid.Col = c_col
End Sub
当你找到所要定位的行后:
Hflexgrid.Row = aa 'aa表示你找到的行
Call hflexgrid_EnterCell '当前行颜色高亮显示
Hflexgrid.TopRow = Hflexgrid.Row
'单击某一单元时,改变该行颜色
Dim i_Col As Integer
Dim c_col As Integer
c_col = Hflexgrid.Col
If c_col > 0 Then
For i_Col = 0 To Hflexgrid.Cols - 1
Hflexgrid.Col = i_Col
Hflexgrid.CellBackColor = vbgreen
Next i_Col
Hflexgrid.Col = c_col
End If
End Sub
Private Sub hflexgrid_LeaveCell()
'当某一行失去焦点时,改变成默认颜色
Dim i_Col As Integer
Dim c_col As Integer
c_col = Hflexgrid.Col
For i_Col = 0 To Hflexgrid.Cols - 1
Hflexgrid.Col = i_Col
Hflexgrid.CellBackColor = vbWhite
Next i_Col
Hflexgrid.Col = c_col
End Sub
当你找到所要定位的行后:
Hflexgrid.Row = aa 'aa表示你找到的行
Call hflexgrid_EnterCell '当前行颜色高亮显示
Hflexgrid.TopRow = Hflexgrid.Row
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货