Solved

number of labels to set invisible...vb.net

Posted on 2014-10-26
2
283 Views
Last Modified: 2014-10-26
I have 8 labels on a form.

Question: How can I make them invisible using something like this:
           Dim i As Integer
            Dim lbl As Label
            Dim strTemp As String
            For i = 1 To 8
                strTemp = "lblNewCust" & i
                lbl = Me.(strTemp)
                lbl.Visible = True
            Next

Open in new window


Please improve this code as necessary. I am getting error at line 6 ("identifier expected").

Thank you.
0
Comment
Question by:Mike Eghtebas
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 40405199
you can try:
lbl = CType(Controls.Find("Label1", true)(0), Label)

Open in new window

0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 40405217
Thank you
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now