Solved

Line follow mouse pointer

Posted on 2000-03-12
1
217 Views
Last Modified: 2010-05-02
How do I create a line (vertical) that follow the mouse over my form in a specific area? I also want it to run a function when it (the mouse) changes coordinates to update some text in the form.

Thanks!
0
Comment
Question by:bert1
1 Comment
 
LVL 1

Accepted Solution

by:
vsankarv earned 50 total points
ID: 2609481
Dim ht, wt As Integer

Private Sub Form_Load()
ht = Abs(Line1.Y1 - Line1.Y2)
wt = Abs(Line1.X1 - Line1.X2)
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.X1 = X
Line1.Y1 = Y
Line1.X2 = Line1.X1 + wt
Line1.Y2 = Line1.Y1 + ht
'call your function here
End Sub
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…

810 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