Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RichText Control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00866465
Message ID:
00866969
Vues:
17
Hi Kevin,

The following sample code looks for uppercase characters 'UT' before any of specified delimiters. If found, it is set to bold and color changed to red. It's not exactly what you're looking for but it should get you started
* SelChange event of RTF control
lcDelimiters = ",. "
* SelLength = 0 - Nothing selected
IF THIS.SelLength = 0 AND This.SelStart >= 3 ;
		AND (SUBSTR(This.text, This.SelStart,1) $ lcDelimiters) ;
		AND SUBSTR(This.text, This.SelStart-2, 2) = "UT"	 
	* Save Current settings for selected text	
	lnSelStart     = This.SelStart
	lnSelLength    = This.SelLength
	lnSelColor 	   = This.SelColor
	* Select UT and make it bold and red
	This.SelStart  = This.SelStart - 3
	This.SelLength = 2
	This.SelBold   = .T.
	This.SelColor  = RGB(255,0,0)
	* Restore settings for selected text
	This.SelStart  = lnSelStart 
	This.SelLength = lnSelLength 
	This.SelColor  = lnSelColor
	This.SelBold   = .F.
ENDIF	
>What I need is this:
>
>When the user types or pastes a word, then moves the insertion point, I'd
>like to look up the work in a predefined list and then highlight or
>bold the word.
>
>So, the user types in:
>
>
>Customer called about product Widget with a complaint
>

>
>I'd like to highlight thr word 'Widget' in red and bold it.
>
>Anyone have any code on this or any ideas on how to do it?
>
>Many thanks
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform