LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a menu option to invoke the Find in Table dialog that shows up when I right click on a Table control

Hello all -
I have a Table Control implemented in my panel window. I really like the built-in "Find in Table" pop-up that shows up when I right click any cell in the Table. I would really like to have a Menu option in my Panel (i.e. Find in Table as a menu item) so that the user can also find items in the table through the Menu option as well. On choosing the menu option Find, I want to be able to pop-up the same built-in Find in Table dialog that shows up when I right-click on the Table just to have a consistent interface of doing things throughout my user interface.
 
Any help will be appreciated.
 
Thanks a lot!  
0 Kudos
Message 1 of 2
(2,830 Views)
Hello Babi,

There's no easy way to bring up that dialog directly. You could switch the focus to the table and use the FakeKeystroke function to simulate the VAL_POPUP_MENU_VKEY being pressed. But that will only display the Goto/Find/Sort menu. Your user would still have to select find from that menu.

To have the same user experience, you'll have to create your own dialog. It's not that hard to do, in the UI editor. Just put in the right controls until it looks like the built-in dialog. Then, to actually perform the search, you can use the GetTableCellFromValue library function, which has pretty much the same functionality as what it is in that dialog.

Luis
Message 2 of 2
(2,825 Views)