troubleshooting Question

Change Label text with click events

Avatar of NCSO
NCSO asked on
Visual Basic Classic
11 Comments1 Solution190 ViewsLast Modified:

I have a label (label1) on my form and its text value is “View Details”.  What I would like to do is if the user clicks on the view details label; one, change the label1.text value to “Hide Details” and show groupbox1; secondly, if the user now clicks on the label1.text value of “ Hide Details”, make groupbox1.visibility = false and label1.text value back to “View Details”

I currently have the following code but I can not figure out how to make the next click event revert back to the original of groupbox1.visible = false and label1.text = “View Details”

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
        GroupBox1.Visible = True
        Label1.Text = "Hide Details"

    End Sub

Thanks in advance
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros