Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you select text in a memo field?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01144007
Message ID:
01144012
Views:
19
I suspect you need to commit the changes the user made before trying to select anything.

Add a call to .setFocus() inside your WITH.

Dan



>How do you select text in a memo field?
>
>I am trying to select eveything from the current mouse position to the end. It works if you don't type in new text.
>
>I created a simple form with an Editbox having a memo field as its control source. On the form is a button that has this in the click().
>
>
>
>	PROCEDURE command1.Click
>		With Thisform.Edit1
>			nStart = .SelStart
>			nEnd = Len(.Value)
>
>			.SelStart = nStart
>			.SelLength = nEnd - nStart
>			.SetFocus()
>		Endwith
>	ENDPROC
>
>
>
>If the memo field already has data, one can click anywhere in the memo field, and then on the button. The text from the current position to the end is highlighted correctly.
>
>Now in the memo field try adding new data. Press Enter twice and then type some text. Position the mouse somewhere in the new text and click in the meo field. Now click the button. Notice that the selected text is not correct.
>
>How can I get the desired selection to show correctly (from the position of the last click to the end)?
>
>Cyril
Previous
Reply
Map
View

Click here to load this message in the networking platform