LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Rich Text "Set Cursor to end of text"

Hi,
 
I have a rich text ActiveX control that I'm updating during the execution of my program.  The execution can be paused to allow the user to view the information returned.
 
As the user views the information the cursor can be set to any location in the rich text control.  When the execution continues the new information is inserted at the position of the cursor.
 
My question is... When the user selects to resume the execution is it possible to set the cursor to the end of the information previously gathered?  I've tried faking Ctrl+End (using FakeKeystroke (VAL_MENUKEY_MODIFIER | VAL_END_VKEY)) to no avail.
 
Thanks in advance.
 
James.
0 Kudos
Message 1 of 4
(3,324 Views)
Hi James,

I've not heard of this being done before but if you are able to post what you have so far I can take a look and see if it's possible to do this on resume, also which version of CVI are you using?

All the best,
Applications Engineer
0 Kudos
Message 2 of 4
(3,272 Views)

Hi Rob,

I've managed to solve the problem by doing the following:

     // Set the cursor to the start of the text.
     RichTextLib_IRichTextSetSelStart(richTestHandle, 0, 0);
     // Get all the text in the window.
     RichTextLib_IRichTextGetText(richTestHandle, 0, &text);
     // Set the cursor to the end of the text.
     RichTextLib_IRichTextSetSelStart(richTestHandle, 0, strlen(text));

Cheers

James.

0 Kudos
Message 3 of 4
(3,270 Views)

Hi James,

Fantastic news, thanks for letting me know and posting the solution on the forum for the community to see,

All the best,

Applications Engineer
0 Kudos
Message 4 of 4
(3,268 Views)