Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RichTextBox Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00541337
Message ID:
00542376
Vues:
16
>You didnt read my thread.
>
>There are no properties on the RichTextBox to determine
>the text of the current line.
>
>I want to determine the words on the current sentence, then
>set font and color attributes for each word in the sentence.
>
>The .Sel* properties only work on SELected text.

You can determine the current cursor position from the .SelStart property of the RichText control. I use it to determine where the cursor is in the control in order to return it to that position after I perform some action on the text. Changing SelStart sets the SelLength to zero (de-selects any selected text) so store the length before changing the selstart.
* example:
lnPos = thisform.oleRichText.SelStart
lnLength = thisform.oleRichText.SelLength

THISFORM.DoSomething(thisform.oleRichText.textRtf)

thisform.oleRichText.SelStart = lnPos
thisform.oleRichText.SelLength = lnLength
You may have to use some trial and error to figure out how to determine the Text, perhaps by moving the SelStart and setting SelLength to grab the SelText.

-Lou.
"All my life I said I wanted to be someone ...
I can see now that I should have been more specific." -Jane Wagner
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform