Resetting a protected style

General TRichView support forum. Please post your questions here
Post Reply
aoven
Posts: 45
Joined: Wed Nov 09, 2005 7:28 pm

Resetting a protected style

Post by aoven »

How does one change a style of an item in code, if the style has a rvprStyleProtect listed in Protection options?

Aleksander
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

StyleProtect protects from ApplyTextStyle, but does not protect from ApplyStyleConversion (checking this protection option in OnStyleConversion is a good idea, but not necessary).

Or you can temporary remove this option from the style and restore it.

Or you can use nonediting operation: RV.GetItem(i).StyleNo := NewStyle, then call Format.
aoven
Posts: 45
Joined: Wed Nov 09, 2005 7:28 pm

Post by aoven »

Or you can use nonediting operation: RV.GetItem(i).StyleNo := NewStyle, then call Format.
Ah, so this is the one I was looking for, then - thanks!
I saw it already, but was a bit sceptical about using it, since it was a field, not a property.

Aleksander
Post Reply