LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you reset vertical scroll bars to the top?

Hi,

Im relatively new to labwindows, and i have a text box with both scroll bars, i can input text from a file into it
but when it populates the text box, the vertical scroll bar drops to the lowest level, i cant seem to find the SetControlAttribute to control the scroll bars, is there a way?

any help wiould be very much appreciated

Cheers
Justin
0 Kudos
Message 1 of 2
(2,960 Views)
Hi Justin,
What you are after is:

SetCtrlAttribute(..., ..., ATTR_FIRST_VISIBLE_LINE, 0);

Now, if you want the cursor to actually appear at the beginning of the first line, you run into a little glitch which may in fact be a CVI bug. You can use ...ATTR_TEXT_SELECTION_START, 0) to position the caret at the beginning of the text, but it doesn't work as you would expect it to when in coordination with ATTR_FIRST_VISIBLE_LINE. If you just use ATTR_TEXT_SELECTION_START, the caret will move but the box won't scroll up. If you use just ATTR_FIRST_VISIBLE_LINE, the box will scroll up but the caret will remain at the end of the text. I wasn't able to get the scroll and the caret to both go together like I think it should.

Does anyone out there know some other way to move the caret properly, or is this really a bug?

Good luck,
Orlan
Message 2 of 2
(2,956 Views)