LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Text Box Scroll Bar

I have a text box which I am adding text to using
InsertTextBoxLine. I need for the text box to always scroll to the bottom to show the most recent data. I cannot rely on the user to do this manualy because 1) it is a hassle for them and 2) at several points I have popup windows that come up, causing the rest of the panels to be unresponsive to user interaction, but the user still needs to see what is being printed to the text box. I cannot find any way to scroll the box.
Any suggestions?
jackson
0 Kudos
Message 1 of 4
(3,413 Views)
Sure, you can use SetCtrlAttribute on the textbox with the attribute FirstLineVisible to scroll the textbox programmatically. The attached example (written in CVI 6.0) shows you how you could do it by checking the number of lines in the textbox and scrolling the textbox when the number of lines written exceeds the size of the textbox.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 4
(3,413 Views)
There is no vertical scroll attribute for text boxes, although it might be
in a few peoples wish lists. You'll have to use a list box, which is much
more flexible.

"Daniel_Jackson_Peacock" wrote in message
news:50650000000800000073510000-1023576873000@exchange.ni.com...
> I have a text box which I am adding text to using
> InsertTextBoxLine. I need for the text box to always scroll to the
> bottom to show the most recent data. I cannot rely on the user to do
> this manualy because 1) it is a hassle for them and 2) at several
> points I have popup windows that come up, causing the rest of the
> panels to be unresponsive to user interaction, but the user still
> needs to see what is being printed to the text box. I cannot find any
> way to scroll the box.
>
Any suggestions?
> jackson
0 Kudos
Message 3 of 4
(3,413 Views)
Actually, you DON'T have to use a list box. There are attributes for textboxes that let you programmatically scroll them. See my previous post to this thread and the attached example program to see how it's done.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 4 of 4
(3,413 Views)