Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

Creating Twins Panels

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
S_Warrior
Asked:
S_Warrior
1 Solution
 
kretzschmarCommented:
place your panel on a tframe,
create this tframe so often you want
0
 
S_WarriorAuthor Commented:
TFrame?
what is TFrame?
0
 
kretzschmarCommented:
what delphi version do you use?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
S_WarriorAuthor Commented:
Is there any functions that create new panels?
0
 
kretzschmarCommented:
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
 
nestoruaCommented:
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
 
S_WarriorAuthor Commented:
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
 
mikepjCommented:
kretzmar (spelling?) is right use a TFrame; they're great for what you're trying to do.
0
 
S_WarriorAuthor Commented:
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
 
S_WarriorAuthor Commented:
I want to close this question
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now