Solved

Underline text when the mouse scrolls over it

Posted on 2001-07-19
16
177 Views
Last Modified: 2006-11-17
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).
0
Comment
Question by:magnakuz
  • 5
  • 5
  • 5
  • +1
16 Comments
 
LVL 20

Accepted Solution

by:
hes earned 25 total points
ID: 6299827
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6299831
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6299834
Just like hes posted!  :)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:magnakuz
ID: 6299850
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6299852
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
 
LVL 1

Author Comment

by:magnakuz
ID: 6299857
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
 
LVL 20

Expert Comment

by:hes
ID: 6299869
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6299874
"To revert it use"  <---  HUMMMM
0
 
LVL 1

Author Comment

by:magnakuz
ID: 6299877
sorry. My fault... can I chanage the grade?
0
 
LVL 20

Expert Comment

by:hes
ID: 6299989
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
 
LVL 1

Author Comment

by:magnakuz
ID: 6300020
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
 
LVL 1

Author Comment

by:magnakuz
ID: 6300023
Sorry for the hassel..
0
 
LVL 20

Expert Comment

by:hes
ID: 6300373
0
 

Expert Comment

by:ComTech
ID: 6303355
Grade changed by request.

Thanks,
ComTech
Community Support Moderator
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6303402
:)
0
 
LVL 20

Expert Comment

by:hes
ID: 6303406
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question