Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I make the equivalent of OnMouseOut

Status
Not open for further replies.

calian

Programmer
Jun 6, 2000
50
US
I'd like to have the text in a field react (for example, go BOLD) when I let the cursor hover over the field, and react again (text back to normal) when the mouse moves on.

I can use the On Mouse Move event to make the BOLD, but moving off the field does not cause it to return to normal.

Thanks for any help.

 
Use the Mouse Move events for the form sections. These do not fire when your mouse is over a control so when it does fire it stands to reason that the mouse is not over a control so you can set them all to normal. Durkin
alandurkin@bigpond.com
 
Durkin,

Good catch! I appreciate it.

Anyone else looking to do this, you should probably use some conditional statements. If you just have the statements fire without controls, all the fields involved flicker with every mouse movement. For example

Private Sub txtFieldName_MouseMove()
If Not txtFieldName.FontBold Then
txtNameLast.FontBold = True
End If
End Sub

and in the form's event, you have

Private Sub Detail_MouseMove()
If txtNameLast.FontBold Then
txtNameLast.FontBold = False
End If
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top