Underline text when the mouse scrolls over it

I have a form with some text on it and want it to change when the mouse moves over it. How do I know when the mouse is over the text? I want my text to change to a different font or maybe underlined when the mouse is over it (just like in web pages how the font changes or gets underlined).
LVL 1
magnakuzAsked:
Who is Participating?
 
hesConnect With a Mentor Commented:
If it is in a Label use

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.FontUnderline = True
End Sub

In a Textbox use

Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.FontUnderline = True
End Sub

To revert it use

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.FontUnderline = False
'or Label1.FontUnderLine = False
End Sub
0
 
Dave_GreeneCommented:
Did you put the text directly on the form with the form.print or did you place text into a label?  I would recommend a label for this so that you won't have to determine your mouse location.
0
 
Dave_GreeneCommented:
Just like hes posted!  :)
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
magnakuzAuthor Commented:
Actually I tried the code with the label and it underlines the text but then it doesn't revert back to normal (not underlined) when the mouse is not over the text.
0
 
Dave_GreeneCommented:
magnakuz,

You are not going to win many friends around here with that grading technique...  There was NOTHING in hes' answer to grade anything other than an "A".  His answer was fast and precise.  What more did you want?
0
 
magnakuzAuthor Commented:
It was a fair grade. He didn't tell me to use the form_mouseMove event to undo the underline...


form_mouseMove event to undo the text
0
 
hesCommented:
magnakuz Look at the last sub in my comment, Yes I did say to use the
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.FontUnderline = False
'or Label1.FontUnderLine = False
End Sub
0
 
Dave_GreeneCommented:
"To revert it use"  <---  HUMMMM
0
 
magnakuzAuthor Commented:
sorry. My fault... can I chanage the grade?
0
 
hesCommented:
Yes go to Community Support and place a 0 point question asking a moderator to change the grade. Place a link to this question number and they will change it for you.
0
 
magnakuzAuthor Commented:
I went there and was filling out a form, but there was no area where I could place a 0 point question. They were radio boxes of 25pts and higher. Thats it..

http://devx.experts-exchange.com/jsp/qAskQuestion.jsp?ta=commspt
0
 
magnakuzAuthor Commented:
Sorry for the hassel..
0
 
hesCommented:
0
 
ComTechCommented:
Grade changed by request.

Thanks,
ComTech
Community Support Moderator
0
 
Dave_GreeneCommented:
:)
0
 
hesCommented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.