Ya veo que hemos contestado al mismo tiempo
.
el código te quedaría así:
Código Delphi
[-]
unit celda;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TFrCelda = class(TFrame)
pnl1: TPanel;
pnl2: TPanel;
CheckBox1: TCheckBox;
private
procedure SetSelected(const Value: Boolean);
function GetSelected: Boolean;
public
property Selected:Boolean read GetSelected write SetSelected;
end;
implementation
{$R *.dfm}
function TFrCelda.GetSelected: Boolean;
begin
Result := checkbox1.Checked;
end;
procedure TFrCelda.SetSelected(const Value: Boolean);
begin
Checkbox1.Checked := Value;
end;
Ahora solo tienes que preguntar por Selected, en lugar de por el Checkbox.Checked, así que tu código sería más o menos:
Código Delphi
[-]
begin
for i:=componentcount downto 1 do begin
if component[i] is TFrameThumb
then begin
if TFrameThumb(component[i]).Selected = true
then CargoEnMiTString;
end;
end;
end;
Si por código necesitas activar el checkbox, puedes usar esto:
Código Delphi
[-]
begin
for i:=componentcount downto 1 do begin
if component[i] is TFrameThumb
then begin
TFrameThumb(component[i]).Selected := true
end;
end;
end;
Saludos