Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

do .visible = true

do .visible = true

do .visible = true

I want to do visible a range of textboxs.
each box is called txtm01, txtm02, txtm03 .....
I want to make a loop that makes visible and invicible some
range of boxs.
So I tried this code, but the machine got stuck
what Im doing wrong?
                z = 0 + z
                z1 = "txtm0" & z
                z2 = z1 & ".Visible = True"
            Loop Until z = 1
Here I want to make visible the textboxs= txtm00 and txtm01

RE: do .visible = true

I would suggest using a control array in this case. You can loop through the textboxes and change any of its (their) properties. Look up 'control array' in the help files, it can give you specifics of how to use them.

In your current code you have an infinite loop situation because the value of 'z' never increments (z = 0 + z just isn't going to do it).

RE: do .visible = true

You can give the same name to all TextBox-es you want. Once you use the same name textbox-es will have an index. then you can work with them ysint that index.


TextBox(1).Visible = True
TextBox(2).Visible = False


RE: do .visible = true

You can also loop through the Controls collection;

Dim X As Control
For Each X In Me.Controls
If TypeOf X Is TextBox Then
X.Visible = False
End If

Good Luck
To get the best from these forums read FAQ731-376 before posting

RE: do .visible = true

Does visual basic.net support indexes?????//
If so ,how""????

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close