Code: Select all
Private Sub cmdFind_Click()
Dim lngOldBackground As Long <<<<<<<<<<<<<<<<
lngOldBackground = Me.cmdFind.BackColor <<<<<<<<<<<<<<<<
Me.cmdFind.BackColor = RGB(255, 0, 0) <<<<<<<<<<<<<<<<
Me.Repaint <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Me.lbFoundStrings.Clear
Me.lbProcedure.Clear
If Len(Trim(Me.tbFind)) > 0 Then
Dim strAr() As String
Dim lngComparisonConstant As Long
If frmLocator.cbCaseSensitive Then
lngComparisonConstant = vbBinaryCompare
Else
lngComparisonConstant = vbTextCompare ' find a given string
End If
Call LoadFoundArrays(strLib, Me.tbFind, strAr, lngComparisonConstant)
If UBound(strAr, 2) > 0 Then
Dim lng As Long
For lng = LBound(strAr, 2) To UBound(strAr, 2) - 1
Dim strListItem As String
strListItem = ""
Dim i As Long
For i = LBound(strAr, 1) To UBound(strAr, 1)
strListItem = strListItem & strAr(i, lng) & " "
Next i
Me.lbFoundStrings.AddItem (strListItem)
Next lng
Else
End If
Else
End If
Me.cmdFind.BackColor = lngOldBackground <<<<<<<<<<<<<<<<
Me.Repaint <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
End Sub
To all the VB{A} experts out there, is there an alternate way to effect this short-term change to a GUI form?
Without those two Me.Repaint commands, the change to RGB(255,0,0) doesn't show up at all. I suspect that the GUI form retains control.
Thanks, Chris