LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select text programatically in textbox in order to highlight it

I am plotting a line calculated from a string. I can select regions on the
plot using graphcursors, and would like to highlite the corresponding
substing in the textbox. I tried to use the SetCtrlAtribute function
(set_selection_start and set_selection_length) however, there is no highligh
in the textbox. My temporary solution is that I copy the selected text to a
string control and can see it there, but it would be much better to see it
in "context" in the textbox.
Any suggestion, how could I do it?

Layosh
0 Kudos
Message 1 of 2
(3,284 Views)
Layosh,

The CVI textbox will show the selected text only when it has focus. So after you set the selection start and set the selection lenght you have to make sure that the texbox control has focus. Just call the function SetActiveCtrl(,,) after you set the selection, this should make the text box active and show the selected text.

Please give this a try and let me know how this goes.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(3,284 Views)