Link to home
Start Free TrialLog in
Avatar of CJ_S
CJ_SFlag for Netherlands

asked on

Controls adding without Placing them

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
Avatar of f15iaf
f15iaf

yes it is posible but it is much more complicated.

yes it is posible but it is much more complicated.

Avatar of CJ_S

ASKER

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'?
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;

Avatar of CJ_S

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of f15iaf
f15iaf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CJ_S

ASKER

was that a yes or a no on my last comment???? You have the points, but please tell me that one thing.
//..... 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.
Avatar of CJ_S

ASKER

Okay, duuuuuuh, I know about the comments, just to be sure that the compiler knows about it.

Thnx!