Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • Last Modified:

is there a way to find the control is Menu?

is there a way to find out to loop thru all the controls in a form and say "this is Menu"?

0
VijayK
Asked:
VijayK
1 Solution
 
VijayKAuthor Commented:
Soory to ask this simple Q. I got it.
0
 
Ryan ChongCommented:
Try:

Private Sub Command1_Click()
    Dim c As Control
    For Each c In Me.Controls
        Debug.Print c.Name & ": " & TypeName(c)
    Next
End Sub

cheers
0
 
pkmnfrkCommented:
Private sub FindMenu()
    Dim ctrl As Control
    For Each ctrl In Controls
        If TypeName(ctrl) = "Menu" Then
            'Do what ever you want
            MsgBox "I found the menu!"
        End If
    Next
End Sub

When for each menu it finds, it'll do whatever is in the If block.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Ryan ChongCommented:
VijayK, feel free to accept an answer or post a request delete this question at Community Support.

http://www.experts-exchange.com/Community_Support/

cheers
0
 
CleanupPingCommented:
Hi VijayK,
This old question (QID 20569706) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GrahamSkanRetiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept answer by ryancys
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GrahamSkan
EE Cleanup Volunteer
0
 
sudhakar_koundinyaCommented:
Sorry to particiapte here
I am wondering.
If we make this as PAQ'ed/points not refunded is right choice. Because actually this is solved by questioner and not requested for deletion

0
 
GrahamSkanRetiredCommented:
Hi sudhakar_koundinya,

Don't feel sorry about participating. It's good to know that someone is taking an interest.

I gather you think that the "I got it" in  VijayK's comment meant that he had found the answer. You may be right. Vijay himself could have asked for a refund, but possibly didn't know how to. If he posts in the few days, we'll change it to PAQ with refund.
Cheers, Graham
0
 
YensidModCommented:
There is a doubt whether "I got it" means asker really got the answer. If in doubt, I like to reward those who take the time to answer the question.  As recommended, points to ryancys.

YensidMod
EE Moderator
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now