From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the control index on a textbox

Solved!
Go to solution

HI,

 

I know that SetCtrlIndex doesn't work on a Textbox control.

However I have to use a Textbox to display a variable number of messages, each one representing a different warning, because of the horizontal scroll bar that is not available on a Listbox control (and some messages could be very long).

I'd like to focus the user's attention on the last of those messages, so at the end of the Textbox, but I'm not able to do this.

Anybody can help me?

 

Thanks

Sergio

0 Kudos
Message 1 of 5
(4,312 Views)

Maybe this link helps Smiley Wink

0 Kudos
Message 2 of 5
(4,307 Views)

Thank you Wolfgang, could be a good idea, unfortunately when I show the textbox I just know the number of messages it contains, while their length can be very different.

So it isn't impossible, but it is not confortable, to count every byte of all the messages in order to locate the byte that represent the beginning of the last message.

Probably I'll let the user to act on the scroll bar in order to reach the end of textbox.

 

Sergio

0 Kudos
Message 3 of 5
(4,297 Views)
Solution
Accepted by Laser

Hi Wolfgang,

your suggestion has been very useful because with further investigation on SetCtrlAttribute for Textbox, I've discovered an attribute that seems to work

 

               SetCtrlAttribute (panel, control, ATTR_FIRST_VISIBLE_LINE, lastTexboxRow);

Thanks

Sergio

0 Kudos
Message 4 of 5
(4,290 Views)

at least indirectly, fine Smiley Happy

0 Kudos
Message 5 of 5
(4,282 Views)