Hi,
WM_ENABLE wird ausgelöst, wenn sich die Eigenschaft Enabled verändert.
Hab schnell eine Kompo geschrieben. Sollte so funktionieren:
Delphi-Quellcode:
unit EditEx;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, StdCtrls;
type
TOnEnable =
procedure(Sender: TObject; Enabled: Boolean)
of object;
type
TEditEx =
class(TEdit)
private
FOnEnable: TOnEnable;
procedure WMEnable(
var msg: TWMEnable);
message WM_ENABLE;
protected
procedure DoEnable(Enabled: Boolean);
dynamic;
published
property OnEnable: TOnEnable
read FOnEnable
write FOnEnable;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Additional', [TEditEx]);
end;
{ TEditEx }
procedure TEditEx.WMEnable(
var msg: TWMEnable);
begin
DoEnable(Msg.Enabled);
end;
procedure TEditEx.DoEnable;
begin
if Assigned(FOnEnable)
then
FOnEnable(Self, Enabled);
end;
end.