RVStyle giving wrong color

General TRichView support forum. Please post your questions here
Post Reply
mwilems1
Posts: 16
Joined: Wed Jul 01, 2009 6:25 pm
Location: Houston, Texas, USA
Contact:

RVStyle giving wrong color

Post by mwilems1 »

I have searched the forums and looked at the demos and still don't have the answer.

I have a DBSRichViewEdit object which I assigned a RVStyle object (RVStyle1). I tried adding a style at design time and at run time using RVStyle1.TextStyles.Add. No matter what I do, the text styles are the default styles and any reference to my inserted styles gives a red background and white letters in the default font.

All I want to do is change the background and text color to black and white respectively.

The TextStyles.Count includes the added styles. Default is 5. With the one I added at design time it is 6. And, when I add another at run time it is 7.

I even tried adding the design time style in the 3rd position and it still has the properties of the default 3rd style.

You would think this would be easy! :x
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

One of possible reasons of the problem: styles are replaced with styles from document (after reading from existing records).

Can you send me a simple project reproducing this problem?
mwilems1
Posts: 16
Joined: Wed Jul 01, 2009 6:25 pm
Location: Houston, Texas, USA
Contact:

Post by mwilems1 »

I tried reproducing this problem with a fresh project lastnight and the styles worked as intended.

The form with the problem (actually forms now since I have two) is based on the ScaleRichView ActionTest demo (ActionTestD2009) Unit3 form. I copied this form, removed a few controls I didn't need and started customizing from there. I added an RVStyle control, linked it to the SRichViewEdit (now a DBSRichViewEdit), and added a text style. I tried adding a text style at design time and adding one in the Form.OnCreate event. Neither had any impact on the default styles. Any text styles beyond index 5 were red background with white letters. I assume this is the default for undefined styles.

This problem occurrs even it I just open the Query with an inserted blank dataset. I would assume there would not be any style information to replace the styles in the RVStyle object. I only interact with a databse using RTF spec and don't use files from the file system other than to save PDF's.

I'm sure it's just a property setting I've got wrong. But, I've been working 24 hours a day for the last 4 days and I just finished a demo meeting I've been getting ready for, so I'm going to take a break and pick it up in the morning (Houston time - GMT-6).

Thanks for putting up with my barrage of questions over the last few days.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I suggest adding a style just before using it (and using FindSuchStyle to reuse existing style, if possible).
Post Reply