Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you select text in a memo field?
Message
From
09/08/2006 02:25:09
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How do you select text in a memo field?
Miscellaneous
Thread ID:
01144007
Message ID:
01144007
Views:
69
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
Next
Reply
Map
View

Click here to load this message in the networking platform