?
Solved

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

Posted on 2014-10-26
2
Medium Priority
?
351 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

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

Open in new window

0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 40405217
Thank you
0

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

718 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