Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Dim XX as menu
Old
  (#1)
Bezeqint
Guest
 
Posts: n/a
Default Dim XX as menu - 06-04-2007, 09:48 AM

Hello. I'm looking for an example of using Dim as Menu in VB6.
Any help would be appreciated.

Thanks !


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Dim XX as menu
Old
  (#2)
Auric__
Guest
 
Posts: n/a
Default Re: Dim XX as menu - 06-04-2007, 09:48 AM

On Sat, 28 Aug 2004 10:27:55 +0200, Bezeqint wrote:

>Hello. I'm looking for an example of using Dim as Menu in VB6.
>Any help would be appreciated.
>
>Thanks !


What exactly are you trying to do? Dynamic menus? Or just setting
references to existing menus?

Reference:
Dim x As Menu
Set x = mnuFoo

Dynamic:
c = c + 1
Load mnuFooBar(c)
mnuFooBar(c).Caption = "blah"
[Dynamic menus must be created as an array in the menu editor.]

Does that help? Or do you need more info?
--
auric underscore underscore at hotmail dot com
*****
A good mentor should point the way with advice and a heavy piece of wood.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Dim XX as menu
Old
  (#3)
Rick Rothstein
Guest
 
Posts: n/a
Default Re: Dim XX as menu - 06-04-2007, 09:48 AM

> On Sat, 28 Aug 2004 10:27:55 +0200, Bezeqint wrote:
>
> >Hello. I'm looking for an example of using Dim as Menu in VB6.
> >Any help would be appreciated.
> >
> >Thanks !

>
> What exactly are you trying to do? Dynamic menus? Or just setting
> references to existing menus?
>
> Reference:
> Dim x As Menu
> Set x = mnuFoo
>
> Dynamic:
> c = c + 1
> Load mnuFooBar(c)
> mnuFooBar(c).Caption = "blah"
> [Dynamic menus must be created as an array in the menu editor.]


To add to your dynamic case, you could Dim As Menu in order to iterate
the control array of menus (named mnuFooBar for your example) to get at
particular properties of each menu item in the control array...

Dim mnu As Menu
For Each mnu In mnuFooBar
Debug.Print mnu.Index & " - " & mnu.Caption
Next

or, depending on how dynamic everything is, using it to filter down to a
particular menu item. For example, if the Caption for one of the items
is "Can you see me?", the following could be used to test it's Visible
property...

Dim mnu As Menu
For Each mnu In mnuTop
If mnu.Caption = "Can you see me?" Then
If mnu.Visible Then
Debug.Print "I can see it!"
Else
Debug.Print "It is invisible!"
End If
End If
Next

Rick - MVP

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top