LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I advance the vertical scroll of a text box to the end

How can I advance the vertical scroll of a text box to the end?
0 Kudos
Message 1 of 3
(3,330 Views)

If all you need to do is to be able to see the latest text written to the text box, then using SetCtrlVal (panel, PANEL_TEXTBOX, "Some String"); to add text is the recommended method, as it automatically scrolls to the end of the box. (This should also work with an empty string if you don't want to add any data to the box contents, but I haven't got access to my CVI at the moment so I can't try it.)

JR

0 Kudos
Message 2 of 3
(3,317 Views)
Hi Steve,

You can also get the number of lines of text in the text box and then scroll to that value:

int rows;
GetCtrlAttribute (panel, PANEL_TEXTBOX, ATTR_TOTAL_LINES, &rows);            //Get total lines
SetCtrlAttribute (panel, PANEL_TEXTBOX, ATTR_FIRST_VISIBLE_LINE, rows);   //Scroll to the end

Let me know if you have any questions.


Kristen
National Instruments
0 Kudos
Message 3 of 3
(3,304 Views)