
13.01.2011, 09:52
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
ну можно же не скрывать "не нужные", а просто иметь столько, сколько нужно:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
ScrollBox1: TScrollBox;
procedure Edit1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Edit1Change(Sender: TObject);
var
n: Integer;
i: Integer;
begin
n:=StrToIntDef(Edit1.Text, 0);
while ScrollBox1.ControlCount>0 do ScrollBox1.Controls[0].Free;
for i:=0 to n-1 do
with TLabeledEdit.Create(Self) do
begin
Parent:=ScrollBox1;
EditLabel.Caption:='TLabeledEdit'+IntToStr(i);
Text:='TLabeledEdit'+IntToStr(i);
Top:=i*Height*2+Height;
end;
end;
end.
http://data.cod.ru/84041
__________________
Пишу программы за еду.
__________________
|