?
Solved

Turning on/off mousemove trapping

Posted on 2004-10-12
4
Medium Priority
?
225 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
[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
4 Comments
 
LVL 25

Accepted Solution

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

Assisted Solution

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 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