Solved

Turning on/off mousemove trapping

Posted on 2004-10-12
4
219 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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