Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Eigene Komponente - Focus (https://www.delphipraxis.net/105880-eigene-komponente-focus.html)

Neutral General 1. Jan 2008 15:21


Eigene Komponente - Focus
 
Hi,

Hab ne Komponente von TCustomControl abgeleitet. Jetzt würde ich gerne mitbekommen wenn man außerhalb der Komponente geklickt hat. Hab leider grad keine Ahnung weil WM_KILLFOCUS nicht funktioniert.
Was kann ich denn da machen?

Gruß
Neutral General

1234588 1. Jan 2008 15:32

Re: Eigene Komponente - Focus
 
WM_KILLFOCUS wird gesendet, wenn der caret (der text cursor) das control gewechselt hat. was dir helfen wird ist die WM_ACTIVATE message

Neutral General 1. Jan 2008 15:38

Re: Eigene Komponente - Focus
 
Hi,

Habs jetzt so gemacht, funktioniert aber nicht...

Delphi-Quellcode:
// Verkürzt
TMeineComponente = class
protected
  procedure Activate(var Msg: TMessage); message WM_ACTIVATE;
end;

procedure TMeineComponente.Activate(var Msg: TMessage);
begin
  inherited;
  if Msg.WParamLo = WA_INACTIVE then
    Focused := -1;
end;

Neutral General 2. Jan 2008 14:45

Re: Eigene Komponente - Focus
 
Hat jemand vielleicht noch ne Idee ? :| Wäre ganz nett... :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz