Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RichText box - adding RTF codes directly
Message
From
17/08/1997 00:24:45
 
 
To
14/08/1997 14:30:17
Renato De Giovanni
Via Fractal Information Systems
São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00044147
Message ID:
00045139
Views:
26
No, I'm not sure. There isn't any property to set to change the background color, but you can asign raw RTF to the control using the .SelRTF property. According to the help file, it supports the \cb# RTF code, which changes the background color of text after that code. It doesn't work. It seems to completely ignore it. The \cf# RTF code (Change Foreground) works like a champ.

At this point, I'm ready to scrap the RichText box, and go with ANY other solution that will give me the ability to display text with different foreground and background colors, and allow scrolling up and down through the text, and allow the user to highlight text with the mouse. I'm considering making my own control using picture boxes, etc... Maybe one picture box per letter, or one per background color change on a line, or something like that.. and have code to handle scrolling them with a scroll bar on the right side, making ones at the top disapear with new ones coming in at the bottom... I don't know. It's just raw ideas right now, and I'm afraid it might be too slow.

>>I'm trying to add a line to a RichText box using the .SelRTF property. I've gotton foreground color (\cf#) to work, but I can't seem to make background color (\cb#) to work at all. No matter what I try, the backgroud color of the text added just stays white. Here's the RTF string I'm adding:
>>
>> rtbDisplay.SelRTF = "{\rtf1\ansi" + ;
>> "\deff0\deftab720" + ;
>> "{\fonttbl{\f0\fmodern Fixedsys;}}" + ;
>> "{\colortbl\red0\green0\blue255;\red0\green127\blue0;}" + ;
>> "\cf0\cb1 This is a test\'0D\'0A" + ;
>> "}"
>>
>>It seems to completely ignore the \cb1. And if I use rtbDisplay.SaveFile "c:\temp\temp.rtf", the \cb gets striped out completely. HELP!!! :)
>
>Hi Lee,
>
>Are you sure the RichText Active-X control supports setting different backcolors for different pieces of text? I didn't find any property for that, only the SelColor property... I suppose it only accepts a backcolor for the whole control, but I'm not sure...
>
>Renato
-----
Lee Perkins
TigerBase Technologies

"Lee is one that would plug his brain into the internet, if he could, and STILL scream for more" - Very good friend of Lee's
Previous
Reply
Map
View

Click here to load this message in the networking platform