#655 – Bubbling Mouse Events Swallowed by Some Controls

When you click a mouse button on a Label control, you’ll see a series of tunneling and bubbling events, as shown below.

However, if you click a mouse button on a TextBox control, you’ll only see some of these events fire.  Specifically, handlers that you define will only see the PreviewXxx versions of the events.  The other events are swallowed by the TextBox control.

In general, controls that do something as the result of a user pressing a mouse button will swallow the related events.  Clicking within a TextBox gives it focus.  Clicking on a Button or ComboBox also results in the control responding to the click, so these controls also swallow the non-preview events.


About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: