Solved

Controls adding without Placing them

Posted on 2000-04-23
9
128 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
  • 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

12 Experts available now in Live!

Get 1:1 Help Now