Go Premium for a chance to win a PS4. Enter to Win

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

Making a Control Array as in VB

i would like to make a Control Array as in VB. (ex.) a control array of TPanel's. Each panel will have the same name but have an index to indicate which one is selected.
most components in VB have a index property just for this purpose, but Delphi components do not that i'm aware of.
thanks for the help in advance.

Jeff
0
jalleman
Asked:
jalleman
1 Solution
 
mirek071497Commented:
You can do this in many ways.

1.define a: array[0..10] of TPanel
2.create tpanels with unique name with number of panel added at the end.

for i:=1 to n do
begin
  with TPanel.Create(..) do
  begin
     name := 'MyPanel'+IntToStr(i);
  end;
end;

then you can use findcomponent to acces this panels.

example : TPanel(findcomponent('MyPanel1')).left := 20;


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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