LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The Text Box problem

Hello,

My programs UI includes the text box control that presents the messages arriving from the ComPort. The new lines arrives very fast, and every time when the new message added to the text box, it is automatically scrolled down to show the last line. Because of it, the user is not able to examine the old messages in the connected mode. I need your suggestions how to prevent the text box to show the last line when it's context updated.

I tried to store the first visible line number before I append a new message to the text box, and then to set the stored value after. It works, but the control "jumps" every time then the new message added. It could work if it possible to prevent text box draw event when the text is updated. Is it possible?

Yevgeny
0 Kudos
Message 1 of 4
(3,339 Views)
Hi,

If you use SetCtrlAttribute (,,ATTR_CTRL_VAL,); rather than SetCtrlVal (,,); then the text will be appended but the text box will not scroll to the last line. This should give you the effect you want.

Regards

Jamie Fraser
0 Kudos
Message 2 of 4
(3,332 Views)
Hi Jamie,

Thanks for you answer, but I afraid it doesn't solves my problem.
You right, the SetCtrlAttribute doesn't scroll the textbox down, but only in the case you are using this function from some control callback (for example command button callback). In this case the TextBox is not active control.

In my case this function located in the ComPort callback, and the Text Box is always active control. So, it doesn't work in this way.

Thanks,

Yevgeny
0 Kudos
Message 3 of 4
(3,326 Views)
Hello Yevgeny,

You might want to check out the suggestions in this post.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 4
(3,294 Views)