×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

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

(OP)
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?
''''''''''''''''''
Do
                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.

e.g.

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


Vlado

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
Next

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

RE: do .visible = true

(OP)
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


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

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