1

For example, in visual basic

Dim VariableName As String
VariableName = "button1"
VariableName.Visible = true

Would set button1 to be visible.

Edit: I got it!

Me.Controls(variableName).Visible = True

1 Answer 1

1

Well VariableName is a string, and strings don't have a a property called "visible".

You want to get the actual Button itself. One way you could do that is something like (untested):

dim btn as Button
for each c in Controls
  if c.name = "button1" then
    btn = c
  end if
next
btn.visible = true

Edit: OP found a better solution, although this could work if you were looking for a textbox with a particular "text" property or something along those lines.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.