Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Create at Runtime TcheckBox
Tue, Dec 18 2012 11:39 AMPermanent Link

pedrini.franck

Axima srl


 Hello

 I want to create Tcheckbox at runtime in a Tpanel this my code :
 procedure TFWC001.IqualitaClick(Sender: TObject);
 var  
   i,j,ileft:integer;
   Difetti : tcheckbox;
 begin
  pcq.visible:=false;  //  pcq is a Tpanel
  pcq.top:=3;pcq.left:=210;pcq.height:=peti.height;pcq.width:=peti.width;
  // Destroy component  
  while (pcq.componentcount) <> 0 do
   begin
     pcq.component[pcq.componentcount].free;
   end;
  ileft:=5;
  for i:=0 to 5 do
  begin
    Difetti:=Tcheckbox.create(application);
    Difetti.parent:=pcq;
    Difetti.name:='pck'+inttostr(i);
    Difetti.caption:='Pluto';
    Difetti.checked:=false;
    Difetti.enabled:=true;
    Difetti.top:=5;
    Difetti.left:=Ileft;
    ileft:=ileft+40;
 end;
  pcq.visible:=true;
end;
   When i use the panel in firefox/chrome
  1 : Caption is invisible
  2 : clickcheck don't work
  
   I tested : difetti.bringtofront;   clickcheck don't work
Tue, Dec 18 2012 3:58 PMPermanent Link

Mark Brooks

Slikware

Avatar

<<pedrini.franck wrote:


 Hello

 I want to create Tcheckbox at runtime in a Tpanel this my code :
 procedure TFWC001.IqualitaClick(Sender: TObject);
 var  
   i,j,ileft:integer;
   Difetti : tcheckbox;
 begin
  pcq.visible:=false;  //  pcq is a Tpanel
  pcq.top:=3;pcq.left:=210;pcq.height:=peti.height;pcq.width:=peti.width;
  // Destroy component  
  while (pcq.componentcount) <> 0 do
   begin
     pcq.component[pcq.componentcount].free;
   end;
  ileft:=5;
  for i:=0 to 5 do
  begin
    Difetti:=Tcheckbox.create(application);
    Difetti.parent:=pcq;
    Difetti.name:='pck'+inttostr(i);
    Difetti.caption:='Pluto';
    Difetti.checked:=false;
    Difetti.enabled:=true;
    Difetti.top:=5;
    Difetti.left:=Ileft;
    ileft:=ileft+40;
 end;
  pcq.visible:=true;
end;
   When i use the panel in firefox/chrome
  1 : Caption is invisible
  2 : clickcheck don't work
  
   I tested : difetti.bringtofront;   clickcheck don't work
>>

Try:

Difetti:=Tcheckbox.create(pcq);

Mark
Image