Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Highlighting the selected row - mshFlexGrid...
Message
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Highlighting the selected row - mshFlexGrid...
Miscellaneous
Thread ID:
00644875
Message ID:
00644875
Views:
60
Hi - I am trying to highlight the selected row of a mshFlexGrid... I have this code...
Private Sub grdOtherAdd_Click()
Dim intRow As Integer 'holds row highlighting info
'get the row to highlight
intRow = grdOtherAdd.MouseRow()

'get the primary key of this record from the address table

'oChildKey = grdOtherAdd.TextMatrix(grdOtherAdd.MouseRow, 0)
'call my highlight
Call myGridHighLight(grdOtherAdd, intRow)
End Sub
and this...
Public Sub myGridHighLight(strGridName As MSHFlexGrid, intRowToHL As Integer)
Dim intLoop As Integer
Dim intInner As Integer
'sub for rowhighlighting

'set all cells backcolor to white to clear any highlights
For intLoop = 0 To (strGridName.Rows - 1)
strGridName.Row = intLoop
For intInner = 0 To (strGridName.Cols - 1)
strGridName.Col = intInner
If intLoop = 0 Then
strGridName.CellBackColor = vbButtonFace
Else
strGridName.CellBackColor = vbWhite
End If
Next intInner
Next intLoop

'highlight the appropriate row

strGridName.Row = intRowToHL
For intLoop = 0 To (strGridName.Cols - 1)
strGridName.Col = intLoop
If intRowToHL = 0 Then
strGridName.CellBackColor = vbButtonFace
Else
strGridName.CellBackColor = vbYellow
End If
Next intLoop

End Sub
I have played around with it all kinds of ways with not much success - it appears to sometimes when I click a row and then scroll to the right???

Please any ideas? I just want highlight a row!
Chris Maiden
Email
Web
Next
Reply
Map
View

Click here to load this message in the networking platform