Bug? ContextMenu.MenuItems: help tooltip error?

jmon

Well-Known Member
Licensed User
Hello,

it seems that the help for "MenuItems" has an error:
B4X:
Dim cm As ContextMenu
cm.Initialize("")
Dim m As MenuItem
m.Initialize("Item", "")
cm.MenuItems.Add(m)
contextmeny.jpg


"MenuItems As List" shouldn't be listed as "[Read Only]" because menu items can be added to it. Or maybe I missunderstood something?

Thanks
 

stevel05

Expert
Licensed User
It is correct, you cannot assign a list using the method. i.e.
B4X:
CM MenuItems = List
You need to get the list then use the Lists methods to add items.

B4X:
CM.MenuItems.Add(Item)
Or to add a list

B4X:
CM.MenuItems.AddAll(List)
 

jmon

Well-Known Member
Licensed User
You need to get the list
Right, I knew I misunderstood the tooltip, but couldn't figure out where! Thanks.
I understood it as if the list was read only :rolleyes:

Thank you
 
Top