delete a style

General TRichView support forum. Please post your questions here
Post Reply
Usch Wildt
Posts: 20
Joined: Fri Sep 29, 2006 11:30 am

delete a style

Post by Usch Wildt »

Hi,

I want to delete Text- and ParaStyles.

In the online help it says about TFontInfos.Delete:
"Obsolete, please do not use.
In order to delete i-th item from text styles, use
TRVStyle.TextStyles.Free"

But is that also correct for BCB6?
TextStyles->Delete(i) and ParaStyles->Delete(i) seem to work fine, but
Free causes an access violation every time.

Thanks for help,

Usch Wildt
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

There is a mistake in the help file, this method was removed already (it was in very old version).
New versions of Delphi/Builder have this method in collection by default.

Code: Select all

TextStyles->Delete(i)
is the same as

Code: Select all

TextStyles->Items[i]->Free();
(and almost the same as

Code: Select all

delete TextStyles->Items[i];
)
Post Reply