Link to home
Start Free TrialLog in
Avatar of bozo7
bozo7Flag for United States of America

asked on

Grouping Objects

I am wondering if there is a way to group a bunch of objects, like labels or edit boxes, so that i can set them visible false or true in one statement not a whole bunch of statements. Please Help
Avatar of Matvey
Matvey

Well, I really doubt you can hide all of them with just one statement, however, you can make a TList of these objects, and set the properties in a FOR loop.
what you can do is make a descendant of a panel (or any other group component) which when set to invisible, automatically makes all his components invisible? What about it?
bozo7,

 come to think of it, panel already supports this offcourse! What a stupid comment I've put above...
 Put all the components in a panel and than make panel invisible. Otherwise if the components are scattered all over a form and can't be put in one panel... make a descendant of TList... (like matvey proposes)

Zif.
Avatar of bozo7

ASKER

I should have clarified.
I also want to enable or disable a group of objects and have the glyphs on the buttons be the disabled glyph not the enabled glyph. When I use a toolbar or panel for this the buttons are disabled but don't show the disabled glyphs.
ZifNab I am rejecting your answer not because it is wrong but because my question was not clear. Sorry
bozo
ASKER CERTIFIED SOLUTION
Avatar of Jacco
Jacco
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bozo7

ASKER

I had to move the SetControlsVisible and SetcontrolsEnabled to the Public section. Otherwise does exaclty what I was looking for.

I really enjoy this exchange of info

bozo