Jump to content

Custom checked control shortcut menu

Recommended Posts

Hi to All,

I need to create a custom shortcut menu that will become checked (or disable) when user click on it. I saw the Set Menu Item Info function in user-menu palets but I don't understand how I can use it. Can somebody tell me how I can use it?

Hi Spaghetti

Love your avatar by the way!!

Yes you will need to use those functions. Attached is an example. Run main.vi and then repeately select Custom Item from the menu to toggle its checked property. You can edit the menu by selecting Edit >> Run-Time Menu (when the VI is not running of course).


Custom Run Time Menu.zip


Link to comment

Thank you for your reply but it isn't what I want to do. I need to check a custom control (right-click) shortcut menu. Controls don't have the menu ref in "shortcut menu selection (user)", I forgot to tell you that my control is a tree control.

I'm working for find the solution and may be I found it. When I'll finish my code I'll post it for share it with everybody.

Link to comment

You should check and uncheck in the 'shortcut menu activation' event.

Deciding wheter a valued needs to be checked should be stored inside your application. A mnu cannot automagically remember wheter it needs to be checked.


Ton is absolutely correct :)

Attached is an example. Run it as before. The principle will be the same for your application - your app must hold the persistent data, then the menu is prepared on the filter event. The menu does not hold the data.

Custom Run Time Menu Control.zip


Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.