(Moderator)
Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
Delphi 2007 Enterprise
|
Re: Controls on list box items?
10. Feb 2010, 21: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")
|