Unless you're willing to delve into the APIs to totally create and handle
menu messages through subclassing, you'll need at least a single member of
the menu array in order to create submenu's on the fly.
--
Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Raymond H." <di*******@hotmail.com> wrote in message
news:ae*******************@news20.bellglobal.com.. .
: Hello,
: I'm not able to create a new sub-menu with your codes. I'd like to
: create a sub-menu that already not exist.
: a+
: Raymond H.
:
: "J French" <er*****@nowhere.com> a écrit dans le message de
: news:3f***************@news.btclick.com...
: > On Sun, 16 Nov 2003 12:14:32 -0500, "Raymond H."
: > <di*******@hotmail.com> wrote:
: >
: > >Hello,
: > > Thank you but it's not exactly what I need. I'd like to create a
: > >sub-menu (that already is not exist) via a Command button. I'd like to
: > >create (not to appear one that already exist) and appear after his
: creation.
: > >I know how to creat menu with 'Load Menu' for exemple, but this need
: first
: > >at least one menu exist. Me, I'd like to creat one when none menu
: already
: > >exits. :-)
: >
: > Load Menu
: > I'm using VB5 - that option does not exist
: >
: > If I wanted to create Menus on the fly I would use Control Arrays
: >
: > That way you can do:
: > Load mnuUtil( 1 )
: >
: > You can 'design' menus inside UserControls as well as inside Forms
: > - so it is quite possible to create something that builds menus from
: > 'designed seed Control Arrays' completely on the fly
: >
: > It is a bit difficult to demonstrate in a NG
: >
: > However this bit of code is in a UserControl :-
: >
: > Public Property Get TheMenu() As Menu
: > Set TheMenu = mnuTop
: > End Property
: >
: > And this is in a Form :-
: >
: > Private Sub Command1_Click()
: > PopupMenu UserControl11.TheMenu
: > End Sub
: >
: >
: >
:
: