#Change Control Arraysd
5 messages in this thread
Hi Mark…
Is there a way to simultaneously change a property in a control array,
affecting all the elements simultaneously? For example, if I had an array
that had several text labels and I wanted to change all their forecolors to
blue. MS VB Help folks say you have to use a for-next loop, changing each
element one at a time.
There are 2 Replies.
Tommy,
A For-Next loop is the only way to go to change the attributes for items in
a control array. It'd be a nice idea to be able to reference the control
arrays as a whole. [Don: add this to the wish list!]
– Ted
Tommy,
Ted is correct – at runtime a For..Next loop is the best way.
FWIW, during the VB beta, I made a suggestion and I'd like to repeat it
here. Hopefully Don Funk will pick it up.
Design Mode Suggestion:
Allow selection of a group of controls using Ctrl-Click (as is done now).
If you change a property on the properties bar, then each control in the
selected group that has that same property should be affected.
Mark
There are 2 Replies.
Mark,
<< universal property changes to selected controls >>
Fantastic Idea! Hopefully it would also be smart enough not to change
common properties that must be unique like caption, tab index, etc. for
those of us dumb enough to try to change them.
–dennis
Mark,
Yeah, I make that suggestion too! Grrr! However, I think we were
hunting for bugs, not affecting the spec. Maybe that's why we didn't have
to pay to beta test it!<g> Anyhow, one nice thing about the ObjectScript
editor (which is actually borrowed from the sparc) is that you can draw a
bounding box with the right mouse button to select a bunch of controls,
instead of having to use the Ctrl-Click on each one. I would like to add
that to your recommendation if I may. -=- Jonathan