Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Turning on/off mousemove trapping

Posted on 2004-10-12
4
Medium Priority
?
226 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

636 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