Discussion:
Iterating through controls...
(too old to reply)
Gene Buckle
2008-05-22 16:24:03 UTC
Permalink
Can someone point me to an example of how to iterate through all
the controls on a TTabSheet?

tnx!

g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
chenzero
2008-05-23 03:43:59 UTC
Permalink
Hello Gene,
TTabSheet has properties to list all child controls. e.g,

for(int i=0;i<TabSheet1->ControlCount;i++) {
ShowMessage(TabSheet1->Controls[i]->Name);
}

those properties are inherited from TWinControl and please refer
TTabSheet help for more details.
Post by Gene Buckle
Can someone point me to an example of how to iterate through all
the controls on a TTabSheet?
tnx!
g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
Gene Buckle
2008-05-25 15:20:22 UTC
Permalink
Post by chenzero
Hello Gene,
TTabSheet has properties to list all child controls. e.g,
for(int i=0;i<TabSheet1->ControlCount;i++) {
ShowMessage(TabSheet1->Controls[i]->Name);
}
those properties are inherited from TWinControl and please refer
TTabSheet help for more details.
Thanks - I ended up doing it a bit differently after some experimenting.
All the controls on the TTabSheet were the same and created at run-time, not
design time.

I used:

foo = (TFancyControl *)Sheet->Controls[index];

to do what I needed to do.

Unfortunately the TTabSheet documentation is pretty sad - they're getting
better, but they're not there yet. :)

thanks!

g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
Loading...