From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Assistance Adding a Toggle Button to a Table Cell

Solved!
Go to solution

Does anyone have an idea as to how to go about implementing a toggle button in a table cell? I am fairly new to coding in CVI and I do understand and was successfully able to insert a regular button into the table cell. However, I would like to know if anyone has been successful in adding a toggle button to the table cell. Thank you for your assistance.

0 Kudos
Message 1 of 2
(2,192 Views)
Solution
Accepted by topic author six_degreez

Given that the table control does not integrate a toggle button cell type, you will need to implement this mechanism by yourself reacting to mouse clicks and keyboard events (normally toggle button are operated with Enter and spacebar keys); visual aspect of the toggle will need to be implemented by changing the image shown on the cell with some sort of marked/unmarked sign.

 

I suggest you to take a look at chess example that ships with CVI (you'll find with by searching for "tables" in the example finder: Help >> Find examples... menu item). That example is built across a big table control that you can operate with the mouse "moving" the pieces across the chessboard: you'll find examples of how to intecept mouse clicks, how to manipulate the image shown on a cell and other useful hints.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(2,165 Views)