is it possible to refer to controls dynamically?
I mean instead of referring to [ textbox1.text] can I have a
mystring = "textbox1"
then refer to the control named in mystring?
Is that possible? What's the syntax for it?
specifically, I have textboxes named book_1 to book_9
I want to have a loop where I refer to properties of the
textbox named "book_" + str(loop_count)
how do I do that?
> question about VB 2005 express .
> is it possible to refer to controls
> dynamically? I mean instead of
> referring to [ textbox1.text] can I
> have a mystring = "textbox1" then
> refer to the control named in mystring.
> Is that possible?
You could upgrade to Visual Basic 6, which has Control arrays
specifically for such purposes. If you don't wish to do that then you
might like to post your question to a dotnet newsgroup. Dotnet (which
is what you are using) is not the same as real Visual Basic and it
does not have Control arrays, but I'm sure it will have some way of
simulating them.
Mike
Like make your own collection of them, as you can with anything, and then
retrieve them by their key, in this case the name.