7,765
社区成员
发帖
与我相关
我的任务
分享
VB codePrivate 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 = &HFFFFC0
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
Private Sub HFlexGrid_Click()
'单击某一单元时,改变该行颜色
HFlexGrid.CellBackColor = &HFFFFC0
End Sub
Private Sub HFlexgrid_LeaveCell()
'当某一行失去焦点时,改变该行颜色
HFlexGrid.CellBackColor = vbWhite
End Sub