Solved

Turning on/off mousemove trapping

Posted on 2004-10-12
4
220 Views
Last Modified: 2010-04-23

posts: 4
since: Mar 10, 2004
from: Liverpool, England  This topic is rated 1 point.  
 
I trap mouse moves on a form so a can select a range of control array textboxs. However when I use a commondialog box to open a file the mousemove event is still trapping mouse moves which causes problems when I close the Dialog Box.
Is there any way to disable the mousemove event when I open a dialog box?
 
 
0
Comment
Question by:DennisKeeling
4 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 25 total points
ID: 12285655
Hi DennisKeeling,

just use removehandler,

something like this

Private Sub ron(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        MsgBox("hello")
    End Sub

AddHandler Me.MouseDown, AddressOf ron         ' to add the mousedown handler
RemoveHandler Me.MouseDown, AddressOf ron   ' to remove the mousedown handler

0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 25 total points
ID: 12304578
I can't reproduce your problem:

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        Label1.Text = e.X & ", " & e.Y
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OpenFileDialog1.ShowDialog()
    End Sub

When the dialog is open, passing my mouse over the form does not result in the coordinates updating in the label.  Could you explain a little more how your app is setup?

~IM
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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 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

12 Experts available now in Live!

Get 1:1 Help Now