LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you high light a table control row by clicking on it?

How can you high light a table control row by clicking on it?

0 Kudos
Message 1 of 5
(1,373 Views)

Are you talking about when you are in the development environment in edit mode?

 

Move your cursor to the edge of the table and you'll see it turn into an arrow.  (Assuming you have auto-tool on.)

 

If Auto-tool is turned off, then make sure the pointer arrow (top center of the cursor toolbox) is selected, and then you can select anywhere on the control.

0 Kudos
Message 2 of 5
(1,349 Views)

No during run time when the end user is actually using the program.

I want to make it easier to distinguish what line, row of the table is being selected.

 

0 Kudos
Message 3 of 5
(1,338 Views)

Something like this may do what you want with some more work (e.g. mousedown event, clear other cells first, etc.)

Example_VI_BD.png

0 Kudos
Message 4 of 5
(1,298 Views)

As Mancho00 started to demonstrate, there is a LOT you can do (programmatically) with the table control/indicator.  When you see a sophisticated user interface based around a table, you can be sure that the underlying code has one or more events configured on the table, typically Mouse Down, Mouse Up, Mouse Move, etc.

 

These events all return a reference to the table (handy if you have more than one table and want the same code to manage them all), and generally a coordinate cluster with mouse x&y relative to the table's origin, along with which mouse button was used, and whether a modifier like shift/alt/ctrl was held down.  Use this data with some of the handy properties and methods of the table class (like the method Point to Row Column) to find out what cell coordinate was clicked, moved across, or released over.

 

As for what to do with this info - Mancho00's code fragment shows one example.  First declare the ActiveCell (in row/column coordinates), then you can apply a background color, a text color, bold the font, etc.  Take the time to learn what the "special" (negative) values in ActiveCell mean: (-1) means the header cell for the associated row/column, and (-2) means ALL the cells of the associated row/column.  (It works perfectly logically, though always feels backwards to me; for example, (-1,4) means the column header for column 4; (2, -1) means the row header for row 2; (5, -2) means ALL cells in row 5.)

 

Note also that you can register for events on a table indicator (even one that's marked disabled), so you can process events on tables even where there's no option for the the user editing the table's content.  I use this technique a lot - a table is a summary display of fairly dense information - but a mouse click (or touchscreen touch) tells me the user wants to drill into one particular row or cell for some other detailed view.

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 5 of 5
(1,279 Views)