"romy" <ro******@Powerup1.com> wrote in message
news:uz**************@TK2MSFTNGP12.phx.gbl...
I have a set of linkButtons controls in a form, which I want to
iterate on them and change their text property.
You /could/ loop through the Controls collection of the Form,
looking for LinkButtons. Sadly, this /only/ works when all the
LinkButtons are actually placed /on/ the Form and not inside
any "container" controls, like Panels or GroupBoxes, in which
case you have to [recursively] scan the Controls Collection of
each container!
Alternatively, if the LinkButtons are all set up at Design Time,
create a - gasp - Control Array. No, don't laugh; I actually
mean an Array of Controls or, in this case, of LinkButtons, as in
Private AllLinkButtons as LinkButton() = { _
Me.LinkButton1, Me.LinkButton2, Me.LinkButton3
...
}
Then, you can simply use
For Each eLB as LinkButton in AllLinkButtons
eLB.Text = "whatever"
Next
HTH,
Phill W.