Keeping a panel on top of an image


2005-03-06 09:57:10 AM
delphi176
I'm having a problem giving me headaches:
Put a TPanel above an TImage. If you update the TImage, it is ok,
the TPanel is still on top.
But if using the 'WS_EX_TRANSPARENT' parameter in the panel,
if you update the TImage, the Panel is behind the image, despite
the best my brain can think about at this late hour.
Has anyone an idea for keeping it on top or is it a Windows curse ? Nor
Refresh, nor BringToFront, nor Paint manage to workaround, aww :-(
--------------------------
Code:
[...]
type TTempPanel = class(TPanel)
protected
procedure CreateParams(var Params: TCreateParams); override;
end;
[...]
procedure TTempPanel.CreateParams(var Params: TCreateParams);
begin
inherited;
if not (csDesigning in ComponentState) then Params.ExStyle :=
Params.ExStyle or WS_EX_TRANSPARENT;
end;
[...]