LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I synchronize two textboxes with one scrollbar?

How do I synchronize two textboxes (identical size and # of lines inserted) with the vertical scrollbar displayed by one of them?
0 Kudos
Message 1 of 3
(3,211 Views)

Hello,

There are a few things you could do to solve your problem.

The first one is: create a fake scollbar to control the vertical offset in you textboxes. Take a look at this message: http://forums.ni.com/ni/board/message?board.id=180&message.id=22577&query.id=27494#M22577

Another thing you could try is catching the left-click of the mouse and then use a timer to keep polling for the vertical offset of you textbox, and update the second textbox programatically: http://forums.ni.com/ni/board/message?board.id=180&message.id=3204&query.id=27472#M3204

 

0 Kudos
Message 2 of 3
(3,204 Views)
You could do something with the ATTR_FIRST_VISIBLE_LINE attribute; get this value from one text box and set the other text box to the same value. You probably need to trigger this on an EVENT_CLICK on the first text box, but be aware that you will still be able to set the scroll position (by dragging the scrollbar) without any event being generated and so without any callback trigger. If this is not good enough you could always use a timer callback to periodically perform this operation.
 
JR
 
(Must learn to type a bit quicker...)

Message Edited by jr_2005 on 06-06-2006 04:51 PM

0 Kudos
Message 3 of 3
(3,202 Views)