Solved

Turning on/off mousemove trapping

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 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