Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Alt key supresses MouseMove messages

$
0
0

When I press the Alt key, I no longer get MouseMove messages for my Windows Form until I press the Alt key again.  How can I stop that from happening?

This doesn't happen for Shift or Ctrl, just Alt.  It seems to be related to the Menu bar functionality.  But I don't have a MenuBar in my windows form.

Steps to reproduce:

  1. Create a new windows forms application from the template (I'm working in C#)
  2. Open the designer for Form1.  Open the properties window (F4) and go to the Event's tab (events button)
  3. Add a handler for Form1's MouseMove by double-clicking MouseMove in the property window.
  4. Add a TracePoint to the code for MouseMove (Add a breakpoint, and right-click the breakpoint, and choose "When Hit..." and check "Print a message" and "Continue execution")
  5. Run the app (F5)
  6. Move the mouse around on the form, Notice that the TracePoint messages are being displayed in the debugger's output window.
  7. Tap the Alt key.
  8. Move the mouse around on the form. Notice that there are no more TracePoint messages being displayed in the debugger's output window. :(

(NOTE: If you press the Alt key again, you'll get MouseMove messages again.)

How can I prevent this from happening so that I always get MouseMove messages even if the user happens to press and release Alt?



Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>