Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21120

[RESOLVED] Trouble setting the forecolor of a MSflexgrid

$
0
0
I am trying to change this 2 column 8 row selected cells from blue to red,but it doesn't work.

Code:


       
no reason Code:

       
  1. Private Sub Command2_Click()
  2. Dim Hits As Integer
  3. Dim i As Integer
  4. Hits = 7
  5. On Error Resume Next 'surpress error if blank cell
  6. For i = 1 To flexStatus.Rows - 1
  7. If flexStatus.TextMatrix(i, 0) = Hits Then
  8. MsgBox "you won hits  " & Hits & " amount " & flexStatus.TextMatrix(i, 1)
  9. flexStatus.Row = i
  10. flexStatus.Col = 0
  11. flexStatus.ForeColor = vbRed
  12. flexStatus.Row = i
  13. flexStatus.Col = 1
  14. flexStatus.ForeColor = vbRed
  15. Exit Sub
  16. End If
  17. Next


what is wrong ?

Viewing all articles
Browse latest Browse all 21120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>