Hola,
tambien puedes crear una variante del componente, sobreescribiendo la propiedad Checked
Código Delphi
[-]
type TCheckBox=class(stdctrls.TCheckBox)
...
private
FOnChange : TNotifyEvent;
protected
procedure SetVChecked(c : boolean);
function GetVChecked : boolean;
published
property Checked : boolean read GetVChecked write SetVChecked;
property OnChange : TNotifyEvent read FOnChange write FOnChange;
end;
...
procedure TCheckBox.SetVChecked(c : boolean);
begin
inherited Checked := c;
if Assigned(FOnChange) then FOnChange(self);
end;
function TCheckBox.GetVChecked : boolean;
begin
result := inherited Checked;
end;
algo asi. No se si te dara error al ya existir la propiedad checked. Si es asi, casi que lo mejor seria crear el componente de nuevo desde TCustomCheckBox. Un saludo, y espero que al menos cojas alguna idea que te sirva.
PD: creo que existen directamente los métodos SetChecked y GetChecked en la misma TCheckBox. En ese caso, se reduciria lo anterior a algo asi:
Código Delphi
[-]
type TCheckBox = class (stdctrls.TCheckBox)
private
FOnChange : TNotifyEvent;
protected
procedure SetChecked(Value : boolean); override;
public
published
property OnChange : TNotifyEvent read FOnChange write FOnChange;
...
end;
...
procedure TCheckBox.SetChecked(Value : boolean);
begin
inherited SetChecked(Value);
if Assigned(FOnChange) then FOnChange(self);
end;
end;
Lo mismo, a ver si te sirve. Saludos.