11-15-2022 01:46 PM
@billko wrote:
@paul_cardinale wrote:
You can't grey it out, but you can remove it.
Sure you can grey it out.
Paul's earlier post was saying that you can TRY to do this, but you can't actually do it to an application menu item, as it returns error code 1164. My post was referring to that item since the OP said it was a custom run time menu.
11-15-2022 02:32 PM - edited 11-15-2022 02:37 PM
Which LabVIEW version is that? We talk about a control pop-up menu, right? I would be flabbergasted if that doesn’t suddenly work anymore, the latest time I did conditionally discard that event and modify the menu was in an application in 2018 that I just recently revisited and it definitely works and has done so since the event structure supports menu events.
If you talk about the window menu as your later code example shows you can only change the menu if you use a custom menu, not the default menu. This is because the default menu only exists once and is reused in every VI that does not use a custom menu.
11-15-2022 03:33 PM - edited 11-15-2022 03:42 PM
@BertMcMahan wrote:
@billko wrote:
@paul_cardinale wrote:
You can't grey it out, but you can remove it.
Sure you can grey it out.
Paul's earlier post was saying that you can TRY to do this, but you can't actually do it to an application menu item, as it returns error code 1164. My post was referring to that item since the OP said it was a custom run time menu.
If that didn't work, a lot of applications that I made wouldn't work. So in conclusion, I must've totally misunderstood the issue.
Edit: I assumed we were talking about custom menu items. It never occurred to me to try to disable an application item in a custom menu.
11-16-2022 03:15 AM
Thanks to all.
Actually, I already found the menu item settings VI, but I was looking for a simple way to lock the entire menu at once. Setting single menu items to deactivated, which means grayed out, works.
11-16-2022 08:50 AM
In my humble opinion, it is better to grey out a menu item rather than removing it, or even worse, making the menu not available at all. With a greyed-out item the user knows that the item is not available. Making the menu not available at all, user might just think that he did not click at the right time or spot, that there is a bug, etc...
11-16-2022 09:14 AM
Right, that's what I did. Gray out.