Solved

Form and control programming

Posted on 2002-06-23
2
168 Views
Last Modified: 2010-04-04
ok. simple, question. how, from a TForm1 procedure can i create a new form control (say for example create a new text box)?
0
Comment
Question by:tim_nash
2 Comments
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 40 total points
ID: 7101906
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
 

Author Comment

by:tim_nash
ID: 7101922
thanx. exactly what i wanted.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now