"mouseover" flicker

  • Thread starter judy jones via AccessMonster.com
  • Start date
J

judy jones via AccessMonster.com

I have created a mouseOver effect by changing backColor and borderWidth.
Looks good, unless... I leave the mouse hovering the screen (most anywhere)
for too long. Then I get a flickering effect. And also, the properties
window (if still open from designing) flickers immediately and 'viciously'.

I can tell from discussion threads that this has been discussed, but can't
find the thread that actually addresses the issue. Any 'enlightenment'
appreaciated.
judy

My code (for 1 of the 8 buttons) is below.

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label17.BackColor = 10092543
Label17.BorderWidth = 1
End Sub

Private Sub Label17_Click()
DoCmd.Close
DoCmd.OpenForm "frmDonors"
End Sub

Private Sub Label17_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label17.BorderWidth = 2
End Sub

Private Sub Label17_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label17.BackColor = 16777215
End Sub
 
M

Marshall Barton

judy said:
I have created a mouseOver effect by changing backColor and borderWidth.
Looks good, unless... I leave the mouse hovering the screen (most anywhere)
for too long. Then I get a flickering effect. And also, the properties
window (if still open from designing) flickers immediately and 'viciously'.

I can tell from discussion threads that this has been discussed, but can't
find the thread that actually addresses the issue. Any 'enlightenment'
appreaciated.
judy

My code (for 1 of the 8 buttons) is below.

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label17.BackColor = 10092543
Label17.BorderWidth = 1
End Sub

Private Sub Label17_Click()
DoCmd.Close
DoCmd.OpenForm "frmDonors"
End Sub

Private Sub Label17_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label17.BorderWidth = 2
End Sub

Private Sub Label17_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label17.BackColor = 16777215
End Sub


I think all you have to do is avoid setting the properties
when they're already set (preventing the constant repainting
the form).

Private Sub Label17_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Label17.BackColor <> 16777215 Then
Label17.BackColor = 16777215
End If
End Sub

Similarly for the Details MouseMove event and your other
controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top