Form Code Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some code that I use on my switchboard to render a "mouse over" effect
in my "Image -based" buttons. Simple in that as I hover over a button; the
code adds a yellow border around the button. I move the mouse away from the
button and the border disappears. Here is mi issue; my buttons are close
together and as such when I quickly move my mouse over 3 or 4 buttons the
code can not react fast enough to eliminate the borders from subsequent
buttons; thus I end up with the yellow border displaying in 5 buttons until I
move my mouse completely off the button array.

I am thinking that a TIMER event would help; so that as I hover over a mouse
button; it would display the border for i.e. 2 seconds. My problem is that I
can not get the timer event properly nested in the existing code. Can some
take a look at my code and offer suggestions on how I may fix: Code as
follows:

PS: Line 2 below (Me.TimerInterval = 2000 ) is my problem and does not work
properly

-----

Option Compare Database
Option Explicit


Private Function LabelMouseMove(strLabelName As String)
Me.TimerInterval = 2000
On Error Resume Next
With Me.Controls(strLabelName)
.BorderColor = 65535

End With
End Function


Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
LabelNormal
End Sub
Private Function LabelNormal()
On Error Resume Next
Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is Image Then
With ctl
.BorderColor = 1
End With
End If
Next

End Function

---------------
 
Well, for starters, you haven't posted any code I can see for your
Form_Timer event.
Second, every time you move your mouse (Mouse_Move), you're resetting the
border color of all your buttons. I'd expect this could cause considerable
flicker, as well as very potentially turning your yellow border off before
you really want...
 
Back
Top