?
Solved

Underline text when the mouse scrolls over it

Posted on 2001-07-19
16
Medium Priority
?
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 5
  • +1
16 Comments
 
LVL 20

Accepted Solution

by:
hes earned 100 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

752 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