Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Show the code where you do it.normally said:I can hilight a row when mouse goes over the grid.
Option Explicit
Private ChangedGrid As Boolean
Private RowActual As Integer
Private HiRow As Integer
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim r As Integer
Dim c As Integer
If ChangedGrid Then
ChangedGrid = False
With Grid
For r = 1 To .Rows - 1
.Row = r
For c = 1 To .Cols - 1
.Col = c
.CellBackColor = vbWhite
Next c
Next r
End With
End If
End Sub
Private Sub Grid_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Grid.MouseRow <> RowActual Then
ChangeGridColor RowActual, 0
RowActual = Grid.MouseRow
HiRow = Grid.MouseRow
ChangeGridColor RowActual, 1
Text1 = "I'm over row " & RowActual
[COLOR=red]ChangedGrid = True[/color]
End If
End Sub
Private Sub ChangeGridColor(RowNum As Integer, Num As Integer)
Dim c As Integer
Grid.Row = RowNum
Grid.Redraw = False
Select Case Num
Case 0
For c = 0 To Grid.Cols - 1
Grid.Col = c
Grid.CellBackColor = Grid.BackColorFixed
Grid.CellForeColor = Grid.ForeColorFixed
Next c
Case 1
For c = 0 To Grid.Cols - 1
Grid.Col = c
Grid.CellBackColor = Grid.BackColorSel
Grid.CellForeColor = Grid.ForeColorSel
Next c
End Select
Grid.Redraw = True
End Sub
Option Explicit
Private ChangedGrid As Boolean
Private RowActual As Integer
Private HiRow As Integer
Private Sub Form_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If ChangedGrid Then
ChangedGrid = False
[blue]ChangeGridColor RowActual, 0[/blue]
End If
End Sub
Private Sub Grid_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Grid.MouseRow <> RowActual Then
ChangeGridColor RowActual, 0
RowActual = Grid.MouseRow
HiRow = Grid.MouseRow
ChangeGridColor RowActual, 1
Text1 = "I'm over row " & RowActual
ChangedGrid = True
End If
End Sub
Private Sub ChangeGridColor(RowNum As Integer, Num As Integer)
Dim c As Integer
[blue]With Grid[/blue]
.Row = RowNum
.Redraw = False
Select Case Num
Case 0
For c = 0 To .Cols - 1
.Col = c
.CellBackColor = .BackColorFixed
.CellForeColor = .ForeColorFixed
Next c
Case 1
For c = 0 To .Cols - 1
.Col = c
.CellBackColor = .BackColorSel
.CellForeColor = .ForeColorSel
Next c
End Select
.Redraw = True
[blue]End With[/blue]
End Sub