The following code produces a menu but not quite what I want. As the image shows that MenuB is linked to a blank space at the end of the MainMenu. How do I attach MenuB to say, the 2nd item in MainMenu?
Dim MainMenu As New WebMenuitem
Dim MenuB As New WebMenuitem
MainMenu.Append(New WebMenuItem("MainMenu 2"))
MainMenu.Append(New WebMenuItem("MainMenu 3"))
MainMenu.Append(New WebMenuItem("MainMenu 4"))
MenuB.Append(New WebMenuItem("MenuB 55"))
MenuB.Append(New WebMenuItem("MenuB 77"))
MainMenu.Append(MenuB)
WebToolBarMenu(Me.ItemWithName("Menu2")).Menu = MainMenu
Dim MainMenu As New WebMenuitem
Dim MenuA As WebMenuitem
Dim MenuB As WebMenuitem
MainMenu.Append(New WebMenuItem("MainMenu 2"))
MenuA = New WebMenuItem("MainMenu 3")
MenuA.append New WebMenuItem("MenuB 55")
MenuA.append New WebMenuItem("MenuB 77")
MainMenu.Append(MenuA)
MainMenu.Append(New WebMenuItem("MainMenu 4"))
Me.ContextualMenu = MainMenu
Well the example shown there works if the main menu has only one item. It doesn’t seem to tell me how to create a hierarchical menu with multiple items.
For my webapps, I went a different route. I used a menu page with treeview control. I used both Jeremie Leroy’s webtreeview control and more recently the GraffitiSuite web treeview. Both work well. It is a completely different paradigm where the menu is used for navigation, and other controls (segmented, tabs, etc.) are used for in-transaction selections. The visual appearence is also much better with the treeview controls. It may or may not suit your application. Other scenarios would be possible, I just settled on this one.
Yeah sorry
I had originally posted then realized the code was wrong & nuked it
Then I just put it back in the same post when I probably should have posted it as a new post
Note New Menuitem(“some text”) creates an item with that text as its label
Appending to that item adds a submenu to it
That sort of does what my original example does - but puts the blanks space on top which holds the submenu. Thanks for trying though.[/quote]
This is what my test show following the information I put in my previous post:
Is that not what you want?
The code:
[code]Dim oneDay as new WebMenuItem(“Un DĂa”)
Dim masMenosUno as new WebMenuItem(“Mañana”)
oneDay.Append(masMenosUno)
masMenosUno = New WebMenuItem(“Ayer”)
oneDay.Append(masMenosUno)
// Create the Dates menu
Dim dateMenu As New WebMenuItem
dateMenu.Append(New WebMenuItem(“Today”))
dateMenu.Append(oneDay)
dateMenu.Append(New WebMenuItem(“Next Week”))
dateMenu.Append(New WebMenuItem(“Next Month”))
// Assign the menu to the dates button
Dim dateButton As WebToolbarMenu
dateButton = WebToolbarMenu(Me.ItemWithName(“DateButton”))
dateButton.Menu = dateMenu[/code]
This is the open event from the sample project in: Examples/Web/Menus/WebToolbarMenu
Edit: I think I’m doing the same that Norman did.