Tom
Tom

Reputation: 6707

FormMouseDown behind components

I noticed that FormMouseDown is not fired when there are any components placed in form and I click the location of e.g. Tlabel?

How can I make the Form mouse events (mousedown, mouseup, mousemove) to trigger always?

Upvotes: 0

Views: 175

Answers (1)

David Heffernan
David Heffernan

Reputation: 613511

You would appear to have a couple of options:

  1. Arrange that every control on your form notifies the form when it process mouse messages.
  2. Use a global mechanism, such as TApplication.OnMessage, to be notified of mouse messages before they are dispatched to controls and surfaced as events of those controls.

Of these two options, the first is an unmitigated disaster. The second is simple to implement, especially if you use a TApplicationEvents object to turn the application object's events into multi-cast dispatch.

Upvotes: 3

Related Questions