Title: RE: [DUG]: trapping mouse down messages

Might be way of track, but a page control has an onenter event which I would imagine is fired when any of the components within one of its pages receive focus ... can you not use this event as the trigger of your color stuff? Other than that you could use the gotfocus or whatever event it is for your various controls, check their owner and set their owners colour appropriately ... just ideas I suspect you have worked through already.

-----Original Message-----
From: Stephen Barker [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 1 July 2003 10:53 a.m.
To: Multiple recipients of list delphi
Subject: [DUG]: trapping mouse down messages



I'm about to give up on this but maybe someone can help:

I've got a complex form split into 3 regions each with a PageControl and
loads of data aware components such as dbgrid, dbedit, dbcombo as well as
labels etc.

I want to know when the user has selected one of the 3 regions by clicking
anywhere (label, dbedit, panel, dbgrid etc), and appropriately hilight that
region by changing the color of the background panel, grid etc.

Have tried trapping WM_LBUTTONDOWN etc as well as subclassing the form's
wndproc, but this doesn't work as some controls have their own message
loops.

I even tried to loop through all controls and set their FOnMouseDown private
fields (via TControl) to a common handler, but this is causing me exceptions
in database access for some unknown reason.

Any other ideas?

thanks,
Steve
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
Notice of Legal Status and Confidential Information: This electronic mail message and any accompanying attachments may contain information that is privileged and CONFIDENTIAL.  If you are not the intended recipient you are advised that any use, review, dissemination, distribution or reproduction of the information is strictly prohibited and may be unlawful.  If you have received this document in error, please notify the sender immediately and destroy the message.

Reply via email to