Hi Rob,
What is your component hierarchy?
I presume that as it is clickable it descends from TWinControl, so you can trasp the enter and exit messages. (hopefully)
See below some demo code I wrote to show a descendent of TEdit changing background color on entry and exit.
cheers
Gary
unit Edit1;
interface
uses
SysUtils, Classes, Controls, StdCtrls, Graphics;
type
TEdit1 = class(TEdit)
private
{ Private declarations }
procedure MyExit(var Message: TCMExit); message CM_EXIT;
procedure MyEnter(var Message: TCMEnter); message CM_ENTER;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('GCS', [TEdit1]);
end;
{ TEdit1 }
procedure TEdit1.MyEnter(var Message: TCMEnter);
begin
color:=clYellow;
end;
procedure TEdit1.MyExit(var Message: TCMExit);
begin
//
color:=clWindow;
end;
end.
At 10:17 on 5/09/2006 you wrote
>To : [email protected]
>CC :
>From: Robert martin, [EMAIL PROTECTED]
>Content Type: text/plain
>Attached:
>
>Hi
>
>I have a custom component that expands to show data. When focus changes
>it reverts back to its shrunken state. However I also want it to revert
>to small if the user clicks the mouse anywhere outside of the component
>(the way that TComboBox does if it is dropped down).
>
>I assume I need to trap a windows message to handle this but I just cant
>see which.
>
>Any suggestions ?
>
>--
>Rob Martin
>Software Engineer
>
>phone +64 03 377 0495
>fax +64 03 377 0496
>web www.chreos.com
>
>Wild Software Ltd
>
>_______________________________________________
>Delphi mailing list
>http://ns3.123.co.nz/mailman/listinfo/delphi
>
Ref#: 41006
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
