• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
.NET Framework Developer Center
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
.NET Framework Developer Center > .NET Development Forums > Windows Presentation Foundation (WPF) > What's wrong with the left mouse button in beta2?
Ask a questionAsk a question
Search Forums:
  • Search Windows Presentation Foundation (WPF) Forum Search Windows Presentation Foundation (WPF) Forum
  • Search All .NET Development Forums Search All .NET Development Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerWhat's wrong with the left mouse button in beta2?

  • Thursday, May 25, 2006 7:42 PMKonstantin GonikmanModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    That's weird, MouseDown and MouseLeftButtonDown are not working here. Left-clicking on the button, test1 and test2 event handlers are not hit. There's no problem with the right mouse button.

    <Button  MouseDown="test1" MouseLeftButtonDown="test2" MouseRightButtonDown="test3" />

    A bug?.. Can somebody repro this?

    • ReplyReply
    • QuoteQuote
     

Answers

  • Thursday, May 25, 2006 8:27 PMLesterLobo - MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0
    try the PreviewMouseLeftButtonDown
    • ReplyReply
    • QuoteQuote
     

All Replies

  • Thursday, May 25, 2006 8:16 PMcsammis Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Button elements capture the left mouse down event via the Click event  (or right mouse down, if the system is configured for "right button" clicks), which is probably what's stopping your explicit MouseDown handlers.
    • ReplyReply
    • QuoteQuote
     
  • Thursday, May 25, 2006 8:20 PMKonstantin GonikmanModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Click event works as expected. But why should Click event hinder a MouseDown event?
    • ReplyReply
    • QuoteQuote
     
  • Thursday, May 25, 2006 8:23 PMKonstantin GonikmanModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    Never mind, I've found an explanation on msdn:

     

    Working Around Event Suppression by Controls

    One scenario where preview events are used is for input events and controls. Sometimes, the creator of the control might wish to suppress a certain event from originating from their control, perhaps to substitute a component-defined event that carries more information or implies a more specific behavior. For instance, a Windows Presentation Foundation (formerly code-named "Avalon") Button suppresses normal MouseLeftButtonDown bubbling events in favor of a Click event. If other elements towards the root of your application still wanted an opportunity that event, one alternative is to handle even routed events. But a simpler way is to change the routing direction you handle to be the Preview equivalent PreviewMouseLeftButtonDown.

    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement