flickering labels

spinkung

Registered User.
Local time
Today, 23:04
Joined
Dec 4, 2006
Messages
267
Hi,

i have a form which has a label on and behind it is a a rectangle (with background solid). I am using the 'on mouse move' event of both to create a hover effect on the label. Problem i'm having is that when i move over the rectangle the label flickers a lot.

Is there a way to prevent this or am i just going to have to live with it??

Many Thanks.
 
is the label on a tab control, or just on a rectangle

there is a known problem with unattached labels on tab controls causing the flickering you describe - perhaps it applies to unattached labels superimposed on any other control

remove the rectangle first to see if that makes a difference to the behaviour -or you may be able to replace the label with an unbound text box - make it locked=yes enabled=no, and it will behave like a label
 
unfortunatley exactly the same. I think i might have to put up with it. I've tried a few different things and no results.
 
is it your mousemove code causing the issue - you definitely should not get any response from an inert textbox - what is your mousrmove code?
 
Hi,

i have a form which has a label on and behind it is a a rectangle (with background solid). I am using the 'on mouse move' event of both to create a hover effect on the label. Problem i'm having is that when i move over the rectangle the label flickers a lot.

Is there a way to prevent this or am i just going to have to live with it??

Many Thanks.

You shouldn't have to live with it.

When people use the mouse move event, it's often because they want it to trigger ONCE to hide some other control (or change it's colour or so on). The way they do it is to keep firing as the user moves the mouse around some area or control. That's why you see it flickering.

You can often solve it by having it only call the mouse move event conditionally. So, if you've already hidden the control (or colour change or whatever), then it won't fire again unless it's changed back.

In other words, instead of the code looking like:

Code:
Private Sub MyControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

me.MyRectangle.visible = False

End Sub

Try this:


Code:
Private Sub MyControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

if me.MyRectangle.visible = true then
  me.MyRectangle.visible = False
End if

End Sub

Let me know if this helps any...

SHADOW
 

Users who are viewing this thread

Back
Top Bottom