Form and control programming

ok. simple, question. how, from a TForm1 procedure can i create a new form control (say for example create a new text box)?
tim_nashAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
marcoszorrillaConnect With a Mentor Commented:
Try this very simple example:

procedure TForm1.Button1Click(Sender: TObject);
var
txtbox:Tedit;
begin
        txtbox:=Tedit.Create(form1);
        txtbox.Name:='MyEdit';
        txtbox.Parent:=form1;
        txtbox.Top:=Form1.Height div 2;
        txtbox.Left:=Form1.Width div 2;
        txtbox.text:='My Edit';
        //txt.OnClick := MyEvent;
end;


Best Regards.
Marcos.
0
 
tim_nashAuthor Commented:
thanx. exactly what i wanted.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.