Search code examples
tagspowerbuilder

How can i hide the menu item 'PARTS' in powerbuilder?


How can i hide menu item that having a tag of PARTS?

SCREENSHOT


Solution

  • I would create a public function on the menu class (in my app: m_main) without return value.

    mf_HideByTag(string as_tag) >>>
    
    // Hide each menu item having Tag = <as_tag>
    long i
    for i = 1 to UpperBound(Item)
       if Item[i].Tag = as_tag then Hide(Item[i])
    next
    

    Call this function from anywhere like:

    m_main.mf_HideByTag('PARTS')
    

    NOTE: This function does no recursive search through the drop down menus. It only parses the immediate menu bar items.