Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if button is visible

Status
Not open for further replies.

associates

IS-IT--Management
Aug 2, 2005
59
0
0
AU
Hi,

Can anyone tell me how to check if a button in a form is visible or not? because i am using the same form to perform two different actions and The easiest way (i think) is to be able to find this out. One form has all the buttons enabled as well as visible whereas the other form only has a certain number of buttons visible.

Thank you in advance and look forward to hearing from you
 
Sorry,

I just found out that it is possible to check if buttonA is visible or not.

However, i got this message when doubleclicking an item from the listbox. The message is
"runtime error 2455, you entered an expression that has an invalid reference to the property isvisible"

Here is my code:
Private Sub MyListBox_DblClick(Cancel As Integer)
If Me.CM_EditButton.IsVisible Then
MsgBox "Yes, it's visible"
'then do actionA
Else
MsgBox "No, it's not visible"
'do actionB
End If
End Sub

Your help is greatly appreciated.

Thank you in advance
 
How about
Code:
If Me.CM_EditButton.Visible then

 
Thank you DK87

It works now. great work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top