Results 1 to 4 of 4

Thread: [RESOLVED] Enumerate menus

  1. #1

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Resolved [RESOLVED] Enumerate menus

    Probably a stupid question, but I can't find it... Can the menu's in a form be enumerated? There doesn't seem to be a Menus collection or something like that.
    VB Code:
    1. Dim x as Menu
    2. For Each x In '???
    Thanks.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Enumerate menus

    VB Code:
    1. Dim ctl As Control
    2. For Each ctl In Me.Controls
    3.     If TypeOf ctl Is Menu Then
    4.         ' do something
    5.     End If
    6. Next ctl

  3. #3

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Re: Enumerate menus

    Brilliant... why didn't I think of that?

    (And I still can't rate you...)
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Enumerate menus

    Quote Originally Posted by TheVader
    Brilliant... why didn't I think of that?

    (And I still can't rate you...)


    Basically everything is in .Controls, so using Typeof...Is, you can enumerate any type of control you want

    edit: I think it is 10 people you have to rate before you can rate the same person again.

    Edit: penagate is correct. Once you have repd someone, you must give reps to at least 10 different members before you are allowed to rep that person again. - Hack
    Last edited by Hack; Jun 6th, 2005 at 10:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width