procedure TForm1.Button2Click(Sender: TObject);
var edit1:TEdit;
combox1:TComboBox;
begin
if true then
begin
edit1:=TEdit.create(self);
edit1.parent:=form1;
edit1.left:=10;
edit1.top:=10;
end
else
begin
combox1:=TComboBox.create(self);
combox1.parent:=form1;
combox1.left:=10;
combox1.top:=10;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Edit: TEdit;
ComboBox: TComboBox;
begin
if 1=1 then
begin
Edit:=TEdit.Create(self);
edit.Parent:=self;
edit.Left:=0;
edit.Top:=100;
edit.Visible:=true;
end
else
begin
ComboBox:=TComboBox.Create(self);
ComboBox.Parent:=self;
ComboBox.Left:=0;
ComboBox.Top:=100;
ComboBox.Visible:=true;
end;
end;