Home > Archive > FoxPro Help and Support > June 2005 > change color









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author change color
bijan

2005-06-05, 3:24 am

Hi
when i find with locate a word in memo field how i can change the color of
the word only the coloe of word not all the text
thankyou
Olaf Doschke

2005-06-05, 9:23 am

> when i find with locate a word in memo field how i can change the color of
> the word only the coloe of word not all the text
> thankyou


That's not easy. You can't do this with a simple display
of the Memo field inside an Editbox. You need to convert the
text to RTF or HTML to be able to have color-modifications
and then use corresponding controls to display RTF or
HTML.

What can be done quite easy but isn't the full solution is using
..selstart and .sellength of an Editbox to select the word found.
But with that you could only highlight one occurance.

If the searchword is "boy" you'd have to set

Edit1.selstart = at("boy",tabTable.mMemofield)
Edit1.sellength = len("boy")

Bye, Olaf.


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com