Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.visual.basic    |    MS Visual Basic discussions, NOT dot-net    |    10,840 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,831 of 10,840    |
|    Jay Taplin to Bob Kochem    |
|    Re: Addressing Menu Items    |
|    14 Jan 06 20:58:41    |
      From: jtaplin@integraware.com              You can do this with the controls collection of the form.              The following code loops through all the controls on the form, checking for       the type of the control. If it comes back as "Menu", then it is a menu       control/object. In other words, if the code makes it to the Debug.Print       line, then you have found a menu item. Good luck!              Private Sub Command1_Click()        Dim ctl As VB.Control               For Each ctl In Me.Controls        If StrComp(TypeName(ctl), "Menu", vbTextCompare) = 0 Then        'Found a menu item        Debug.Print ctl.Name        End If        Next               Set ctl = Nothing       End Sub              "Bob Kochem" |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca