Solved

Underline text when the mouse scrolls over it

Posted on 2001-07-19
16
173 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

14 Experts available now in Live!

Get 1:1 Help Now