Article View: comp.lang.pascal.delphi.components.usage
Article #19Moving components around
From: Zimba
Date: Tue, 17 Nov 1998 00:00
Date: Tue, 17 Nov 1998 00:00
41 lines
2321 bytes
2321 bytes
please I want to be able create components at runtime as my codes below
show but I would like to be able to move them to desired positions. Does
anyone know how I can move them around? Right now I can only create them
with the codes below below I cannot move them around.
Zimba
procedure TOutputForm.FormMouseDown (
Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MyClass: TComponentClass;
MyComp: TComponent;
begin
MyClass := TComponentClass (
GetClass (MainForm.ComboBox1.Text));
if MyClass = nil then
Beep
else
begin
MyComp := MyClass.Create (self);
MyComp.Name := MainForm.GetNextName (MyClass);
if MyClass.InheritsFrom (TControl) then
begin
TControl (MyComp).Left := X;
TControl (MyComp).Top := Y;
TControl (MyComp).Parent := self;
end;
end;
MainForm.UpdateList;
end;
--
*****************************************************************
*PLEASE, TO SEND ME AN E-MAIL REMOVE "REMOVE" FROM MY ADDRESS. *
* *
* *
*****************************************************************
Technical Details
Message-ID:
<36507ECC.2BD4BC5E@bellsouth.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 108890,ad7d8cb1fb4c02ee,start X-Google-Attributes: gid108890,public X-Google-Thread: fb0ea,ad7d8cb1fb4c02ee,start X-Google-Attributes: gidfb0ea,public X-Google-Thread: 109d99,ad7d8cb1fb4c02ee,start X-Google-Attributes: gid109d99,public X-Google-Thread: 112b07,ad7d8cb1fb4c02ee,start X-Google-Attributes: gid112b07,public X-Google-Thread: f973b,ad7d8cb1fb4c02ee,start X-Google-Attributes: gidf973b,public X-Google-Thread: fe2ce,ad7d8cb1fb4c02ee,start X-Google-Attributes: gidfe2ce,public From: Zimba <REMOVEkennaa@bellsouth.net> Subject: Moving components around Date: 1998/11/17 Message-ID: <36507ECC.2BD4BC5E@bellsouth.net> X-Deja-AN: 412590889 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 NNTP-Posting-Date: Mon, 16 Nov 1998 19:35:23 EST Newsgroups: comp.lang.pascal.delphi.components.usage,comp.lang.pascal.delphi.components.writing,comp.lang.pascal.delphi.components.misc,comp.lang.pascal.delphi.components,borland.public.delphi.vcl.components.using,borland.public.delphi.vcl.components.writing