LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show shortcut menu on control programmatically

Hi,

 

I have a string control for which I want to display a shortcut menu when a "." is typed in. I know I can customize shortcut menus through the "Shortcut Menu Activation?" event.

 

My question is: How can I show the shortcut menu programmatically without having to right-click on the control?

 

Thanks in advance!

0 Kudos
Message 1 of 4
(3,043 Views)

Hi Xerxess,

you can use the string control "Key down event". There you can use some Win API functions to simulate the mouse click.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 4
(3,030 Views)

"Xerxess" <x@no.email> wrote in message
news:1235657410000-860922@exchange.ni.com...
> Hi, &nbsp;I have a string control for which I want to display a shortcut
menu when a &quot;.&quot; is typed in. I know I can&nbsp;customize shortcut
menus&nbsp;through the&nbsp;&quot;Shortcut Menu Activation?&quot; event.
&nbsp;My question is: How can I show the shortcut menu programmatically
without having to right-click on the control?&nbsp;Thanks in advance!

I honestly don't think there is a decent way to do this.

The best bet is to simulate a mouse click with a windows API. This will
probably work fine, but the shortcut will also appear if the user right
clicks directly. You can filter the right clicks, because you know when the
click is simulated, because after all, you generete them. It's not a nice
thing, but I'm affrait it's the only way.

Regards,

Wiebe.


0 Kudos
Message 4 of 4
(3,020 Views)