Solved

Controls adding without Placing them

Posted on 2000-04-23
9
129 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A short film showing how OnPage and Connectwise integration works.

914 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

20 Experts available now in Live!

Get 1:1 Help Now