LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

See the active row in a table

Hello,
 
i change the backcolor of the aktive row in my table.
How can i control the screen of the table because i will ever see the akive row i the mid of the table.
 
Thanks
 
wolf4124
0 Kudos
Message 1 of 2
(3,017 Views)
Hi wolf,
 
use the SetCtrlAttribute function with the ATTR_FIRST_VISIBLE_ROW attribute to scroll down through the table. Since you would like to have your active row in the middle of the table, you should substract half of the visible number of rows from this row number. Take a look at the following example:
 
int num_visible_rows, first_visible_row;
// Get the number of visible rows of your table.
GetCtrlAttribute (pnlHandle, PNL_TABLE, ATTR_NUM_VISIBLE_ROWS, &num_visible_rows);
// Now calculate the first row of your table that should be visible.
first_visible_row = active_row - num_visible_rows/2;
if (first_visible_row < 1) first_visible_row = 1;
// Scroll the table.
SetCtrlAttribute (pnlHandle, PNL_TABLE, ATTR_FIRST_VISIBLE_ROW, first_visible_row);

Message Edited by Wim S on 10-31-2006 02:49 PM

Message 2 of 2
(3,017 Views)