Hide top toolbar

I found this code

FUNCTION Example(OBJECT hToolbar)
	// Getting property value
	INT nVisible = _ObjectGetProperty(hToolbar, "Visible");
	// Setting property value
	_ObjectSetProperty(hToolbar, "Visible", 0);
END

I want to use it for hiding the top toolbar in a Process analyst view, so to hide this:

 When I load the PA page I can see, briefly, the toolbar hiding but it comes just as fast back again.

Any ideas?

  • Are you loading a PAV file or using a function to open the page? PAV files contain the customizations of Process Analyst, such as the toolbar states. So you may need to open the PAV file, run your command to hide the toolbar, then resave the PAV file so it contains that change (using a function since you hid the toolbar). The next time you open that PAV you won't have run your command again.

    If you use a function to open the analyst page, that function may customize the view or load a PAV file to preconfigure settings.

  • I load a PA file and call a function to hide the top toolbar.

    FUNCTION HideTB()
    
    	OBJECT hAnalyst = ObjectByName("AN139");
    	OBJECT hToolbars = _ObjectGetProperty(hAnalyst, "Toolbars");
    	OBJECT hMainToolbar = _ObjectCallMethod(hToolbars, "get_Item", 1);
    
    	_ObjectSetProperty(hMainToolbar , "Visible", 0);
    
    END