Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you select text in a memo field?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How do you select text in a memo field?
Divers
Thread ID:
01144007
Message ID:
01144007
Vues:
65
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform