Solved

Controls adding without Placing them

Posted on 2000-04-23
9
132 Views
Last Modified: 2010-04-04
Okay, here's the deal:
when you use Delphi you can always just paint Controls on the forms. Now that is something I don't wanna do anymore...just because I have all these examples with only the source code...
I know that you can use the WinAPI functins and stuff to create a window, but that is something I don't want to do either. I'd like to just have one .pas file and to type everything in it there...
is this possible?
I'm a beginner, and kinda get the big idea about all the items and stuff. The book I have only uses sourcecode too, no explanation from "place this there, place that there".

Anybody?

CJ
0
Comment
Question by:CJ_S
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 3

Expert Comment

by:f15iaf
ID: 2742168
yes it is posible but it is much more complicated.

0
 
LVL 3

Expert Comment

by:f15iaf
ID: 2742170
yes it is posible but it is much more complicated.

0
 
LVL 22

Author Comment

by:CJ_S
ID: 2742178
Okay, then.........could you tell me?
I know about the dynamically creating control elements and placing them on the screen. is that what you mean with 'complicated'?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:f15iaf
ID: 2742191
example:

var
   b:Ttimer;
implemantation

procedure Tform1.func(sender:tobject)
begin
     ......
end;
procedure Tform1.formcreate(sender:Tobject);
begin
     b:=Ttimer.create(form1);
     b.interval:=1;//property
     b.ontimer:=func;//event
end;

0
 
LVL 22

Author Comment

by:CJ_S
ID: 2742211
UHM....so, if I understand this correctly, it determines whether it is an event or property by itself?????....

0
 
LVL 3

Accepted Solution

by:
f15iaf earned 25 total points
ID: 2742228
example:

var
   b:Ttimer;
implemantation

procedure Tform1.func(sender:tobject)
begin
     ......
end;
procedure Tform1.formcreate(sender:Tobject);
begin
     b:=Ttimer.create(form1);
     b.interval:=1
     b.ontimer:=func;
end;



0
 
LVL 22

Author Comment

by:CJ_S
ID: 2742234
was that a yes or a no on my last comment???? You have the points, but please tell me that one thing.
0
 
LVL 3

Expert Comment

by:f15iaf
ID: 2742267
//..... in delphi it means that compiler ignores what said after //
usually it's a coment which wrriten by programers.

you don't need  to write //property or
//event after each action.

events and properties are determinied in
control such as Ttimer from the beginning in their source code.

when you write

b.interval:=1;

a compiler knows that it's a property.
0
 
LVL 22

Author Comment

by:CJ_S
ID: 2743017
Okay, duuuuuuh, I know about the comments, just to be sure that the compiler knows about it.

Thnx!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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