how to determine if a button is shown?

nebchill26

Member
Joined
Oct 8, 2008
Messages
7
Location
San Mateo, Rizal, Philippines
Programming Experience
1-3
does anyone know on how to determine if a button is shown?
i tried something like this

VB.NET:
    If button1.Show = True Then
            MsgBox("The button is shown")
    else
            MsgBox("The button is hidden")
    End If

but the condition i was using does not produce a value,does anyone know on how to do it? tnx
 
does anyone know on how to determine if a button is shown?
i tried something like this

VB.NET:
    If button1.Show = True Then
            MsgBox("The button is shown")
    else
            MsgBox("The button is hidden")
    End If

but the condition i was using does not produce a value,does anyone know on how to do it? tnx
Rocksteady's already mentioned that you should use the Visible property to know if the button's showing on the form or not, but typically button's are disabled not hidden when it's marked as in-accessible. Which means you'll be looking at the Enabled property for that.

So here's a quick example to determine if a button's showing and is enabled or not:
VB.NET:
Messagebox.Show("Button's accessible: " & CStr(Button1.Enabled AndAlso Button1.Visible)
This produces a boolean value and show the result in the messagebox
 
Back
Top