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
Solved

Creating Twins Panels

Posted on 2002-06-13
10
138 Views
Last Modified: 2010-04-04
Hello,

I have a panel with Componets in it.

I want to be able to create X numbers of panels in the same from that will have the same Properties and Componets in it.
0
Comment
Question by:S_Warrior
10 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7075639
place your panel on a tframe,
create this tframe so often you want
0
 

Author Comment

by:S_Warrior
ID: 7075689
TFrame?
what is TFrame?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7075693
what delphi version do you use?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

Author Comment

by:S_Warrior
ID: 7075702
Is there any functions that create new panels?
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 7075743
var t : tpanel;
begin
  for loopvar := 0 to panelsneeded do
  begin
    t := tpanel.create(self);
    t.parent := self;
    t.align := altop;
    t.height := 50;
      // here you could create the controls
      // on your panel like
    with tedit.create(self) do
    begin
      parent := t;
      left := 10;
      top := 10;
      width := 100;
    end;
    with tbutton.create(self) do
    begin
      parent := 1;
      left := 120;
      top := 10;
      width := 100;
      caption := '&Press me';
      onclick := MyPreDefinedOnClickProcedure;
    end;
    t.show;
  end;
end;

just from head

meikl ;-)
0
 
LVL 4

Expert Comment

by:nestorua
ID: 7076301
HI,
If you need it only in the "Design Time" you can do the following:
1.Select your Panel with those Components;
2.Copy it to Clipboard;
3.Paste the content of the Clipboard whatever number of times (in your notations - X) you want.
Sincerely,
Nestorua.
0
 

Author Comment

by:S_Warrior
ID: 7077550
No, I didnt meant to this.

I Already have a Panel that I create in Design Time,

Now at runtime I want to create copys of this panel, so it will have all the Events and Proper of the Org Panel.
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7082774
kretzmar (spelling?) is right use a TFrame; they're great for what you're trying to do.
0
 

Author Comment

by:S_Warrior
ID: 7086914
I dont want to use TFrame I want to know how to copy Component with all of his properties, this is what I want to know.

in this case the Component is TPanel
0
 

Author Comment

by:S_Warrior
ID: 7153873
I want to close this question
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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