Einzelnen Beitrag anzeigen

alzaimar
(Moderator)

Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
 
Delphi 2007 Enterprise
 
#2

Re: Controls on list box items?

  Alt 10. Feb 2010, 20:37
Try a scrollbox. You can create as many controls as you like at runtime.
Delphi-Quellcode:
procedure TForm15.Button1Click(Sender: TObject);
var
  i: Integer;
  CheckBox1: TCheckBox;

begin
  for i := 1 to 20 do begin
    CheckBox1 := TCheckBox.Create(Self);
    with CheckBox1 do begin
      Name := 'CheckBox' + intToStr(i);
      Parent := ScrollBox1;
      Left := 32;
      Top := 2 + 19 * i;
      Width := 97;
      Height := 17;
      Caption := 'CheckBox ' + intToStr(i);
      TabOrder := i - 1;
    end;
  end;
end;
"Wenn ist das Nunstruck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput!"
(Monty Python "Joke Warefare")
  Mit Zitat antworten Zitat