Why do Mouse events for the TextBox not fire?
If you create a handler for the WPF TextBox's mouse events, you will find that the code in your handler never fires. This is because the event is marked as "handled" in the .NET Framework, so it never reaches your code.
To get around this bad behavior, you can use the TextBox's AddHandler() method to register your handler method, passing a true for the handledEventsToo parameter. For example:
this.txtCustomerID.AddHandler(ControlMouseLeftButtonUpEvent,
new MouseButtonEventHandler(txtCustomerID_MouseLeftButtonUp), true);
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 08/16/11
Comment or report problem with topic
