[solved] refering to Menu Items lazarus / 31-LCL ---------------------------------------------------------------------- dbannon · 2017-11-08 02:47 Hi, I want to enable and disable a menu item (in a PopupMenu). This menu item is named MenuItemSync, its caption is 'Sync', and it fires an event called MenuItemSyncClick(). So I think I should be able to say - Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PopupMenuTray.MenuItemSync.Enabled := True;But all I have be able to find that works is - Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PopupMenuTray.Items[14].Enabled := True;And, of course, if I add a remove an item from the menu, it might change the '14' and unless I remember to recalculate, things break. Is there a better way ? David ---------------------------------------------------------------------- jamie · 2017-11-08 03:09 The Menuitems are separate objects but they are cataloged in the items list too.  You can directly set the enable property..  What ever you called it when you created the MenuItem..  MenuItemSync.Enabled := True;  Its not a sub member of the TPopUpMenu.  Look in your Form class and you'll see it there as a stand alone object/Class, just set the Enable property as you wish.  You won't need to remember the index of it in the list. ---------------------------------------------------------------------- dbannon · 2017-11-08 09:16 Oh, wow,  That easy huh ?  And here was I trying to complicate things. Sigh Thanks Jamie, appreciate it ! (Off no to find all those ugly line in my code and fix them!) ---------------------------------------------------------------------- howardpc · 2017-11-08 11:27 Or associate an action with the menuitem and enable/disable via the action.