Solved

Form and control programming

Posted on 2002-06-23
2
170 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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