Einzelnen Beitrag anzeigen

Optiplex

Registriert seit: 5. Mär 2008
131 Beiträge
 
Delphi 2005 Personal
 
#5

Re: Checkbox auf Komponente funktioniert nicht

  Alt 13. Jul 2009, 13:38
Hallo Heiko, ich habe dir mal die wichtigsten Proceduren, wo was passiert, rauskopiert. der Setter wird vom Formular im FormCreate aus aufgerufen nachdem das Objekt Createt wurde.
Delphi-Quellcode:
constructor TBoardEdit.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FBoardCheckBox:=TCheckBox.Create(nil);
//.....
  Enabled:=false;
end;
//===
destructor TBoardEdit.Destroy;
begin
  FBoardCheckBox.Free;
  inherited Destroy;
end;
procedure TBoardEdit.CreateWnd;
begin
inherited;
  FBoardCheckBox.Parent:=Self;
  if csDesigning in ComponentState then FBoardCheckBox.Enabled:=false;
  FBoardCheckBox.Name:=Name+'_TCheckBox1';
  FBoardCheckBox.Checked:=True;
  FBoardCheckBox.Enabled:=false
end;
Dieter
  Mit Zitat antworten Zitat