Bug? ContextMenu.MenuItems: help tooltip error?

Discussion in 'B4J Bugs & Wishlist' started by jmon, Jan 9, 2017.

  1. jmon

    jmon Well-Known Member Licensed User

    Hello,

    it seems that the help for "MenuItems" has an error:
    Code:
    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
     
  2. stevel05

    stevel05 Expert Licensed User

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

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

    Code:
    CM.MenuItems.AddAll(List)
     
    jmon likes this.
  3. jmon

    jmon Well-Known Member Licensed User

    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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice