Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TWinControl.Controls[i]

Posted on 1999-07-22
9
Medium Priority
?
170 Views
Last Modified: 2010-04-04
Which order is given to the Controls in this array? First I thought design order, it seems to be wrong! But I couldn´t find another rule!
Lutz
0
Comment
Question by:Saxon
[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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1390492
hi saxon,

i think its the order how you dropped the controls in the control,
you can reorder it by setting the controlindex to another value,
all indexes behind the new value will be shifted then by one

meikl
0
 

Author Comment

by:Saxon
ID: 1390493
No, if I place e.g. labels (e.g. 4 pcs) and listboxes (e.g. 2 pcs) in mixed order the labels get the lower four indices (0..3) and the listboxes the upper (4..5).
Besides this TWinControl.Contol[i] is write-only. :(
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1390494
? not noticed it

>Besides this TWinControl.Contol[i] is write-only
you mean
Besides this TWinControl.Contol[i] is READ-only?

oops, sorry you can't reorder, it only available for the componentlist :-(

>Which order is given to the Controls in this array?
i don't know, maybe by control-name.

meikl
0
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.

 
LVL 10

Accepted Solution

by:
Lischke earned 200 total points
ID: 1390495
Actually, the controls are ordered by the order they appear ont the form, BUT they are stored in two different arrays (FControls and FWinControls). The controls without window handle (e.g. TLabel) are always first returned before you get the controls with a handle.

Ciao, Mike
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1390496
aha ;-)
0
 
LVL 10

Expert Comment

by:Lischke
ID: 1390497
Meikl, why the smiley? Is something wrong with my answer? :-)

Ciao, Mike
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1390498
Saxon, I think Components[i] is what you need and not Controls[i]

..-=ViKtOr=-..
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1390499
hi mike,

>Is something wrong with my answer?
no, i don't think so, your answer makes sense,
its just a sign, that i've learned a bit more

meikl ;-)


0
 

Author Comment

by:Saxon
ID: 1390500
Great, it works!

It´s right Meikl, I meant READ-only. Because you learned a bit more too, you should take a half of the point to give to Mike ;-)
Viktor I´m not sure but will check it!

Thanks to all for your support!

Lutz
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

660 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