Solved

Underline text when the mouse scrolls over it

Posted on 2001-07-19
16
171 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
Comment Utility
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
Comment Utility
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
Comment Utility
Just like hes posted!  :)
0
 
LVL 1

Author Comment

by:magnakuz
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
"To revert it use"  <---  HUMMMM
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

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

Expert Comment

by:hes
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry for the hassel..
0
 
LVL 20

Expert Comment

by:hes
Comment Utility
0
 

Expert Comment

by:ComTech
Comment Utility
Grade changed by request.

Thanks,
ComTech
Community Support Moderator
0
 
LVL 8

Expert Comment

by:Dave_Greene
Comment Utility
:)
0
 
LVL 20

Expert Comment

by:hes
Comment Utility
Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now