?
Solved

Controls adding without Placing them

Posted on 2000-04-23
9
Medium Priority
?
134 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
Industry Leaders: 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 100 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

Industry Leaders: 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!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 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