Board index » cppbuilder » Click through a panel.

Click through a panel.


2004-01-15 12:16:42 PM
cppbuilder64
Hello.
I want to have a panel over a multiple controls including text controls.
I want to catch Click events on the panel. But i want the controls below
the panel to catch the events as well. Basically as soon as the panel
receives the click it will disappear then the controls below will
receive the focus with correct caret position when applicable.
How can i do this?
 
 

Re:Click through a panel.

Jaepil Kim wrote:
Quote
I want to have a panel over a multiple controls including text controls.
So the text controls are invisible ? TEdit ? TRichEdit ? TMemo ?
Quote
I want to catch Click events on the panel. But i want the controls below
the panel to catch the events as well. Basically as soon as the panel
receives the click it will disappear then the controls below will
receive the focus with correct caret position when applicable.
In the TPanel's OnClick event you can get the mouse coordinates with
GetCursorPos, or you couls have stored them from the OnMouseDown event,
that triggers before OnClick.
Then there is somewhere a function ControlAtPos that could give
you the underlying control.
You have to transform the coordinates to the coordinates for the
control.
Finally with send_message you can send a WM_LBUTTONDOWN and a WM_LBUTTONUP
to the control.
I just wrote this down from memory. Hope it gets you started.
Hans.