Solved

Making a Control Array as in VB

Posted on 1997-11-06
1
177 Views
Last Modified: 2010-04-04
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
Comment
Question by:jalleman
1 Comment
 
LVL 3

Accepted Solution

by:
mirek071497 earned 50 total points
ID: 1349679
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

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

Suggested Solutions

Title # Comments Views Activity
ddeman not working in activex 3 93
Simple Delphi Question 9 83
Magic Software info 18 125
Firemonkey DbLookupComboBox equivalent ? 2 35
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

21 Experts available now in Live!

Get 1:1 Help Now