От: | Disa | ||
Дата: | 12.10.04 08:30 | ||
Оценка: |
type TControlClass = class of TControl;
function CreateControl(ControlClass: TControlClass;
const ControlName: string; X, Y, W, H: Integer): TControl;
begin
Result := ControlClass.Create(MainForm);
with Result do
begin
Parent := MainForm;
Name := ControlName;
SetBounds(X, Y, W, H);
Visible := True;
end;
end;
CreateControl(TEdit, 'Edit1', 10, 10, 100, 20);