trichview.com

trichview.support




Re: I dont think so!


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/28/2003 17:51:23


Text styles are indexed from 0 to TextStyles.Count-1.


RVStyle creates a fake text style when accessing TextStyles with invalid

index (i.e. <0 or >=TextStyles.Count).

So, when you access TextStyles[RVStyle1.TextStyles.Count], you access this

fake item (by default, it has all properties of the 0-th style but red

background).

You can change RVStyle1.TextStyles.Count to 1000000 and you'll get the same

results.




>

> >Last added style has index = RVStyle1.TextStyles.Count-1, not

> >RVStyle1.TextStyles.Count

>

> I dont think so, Sergy. Look to folloing code:

>

>      with RVStyle1.TextStyles do

>      begin

>           Add;

>           Items[RVStyle1.TextStyles.Count].BackColor := clCream;

>           Items[RVStyle1.TextStyles.Count].Size := 50;

>      end;

>

>      if RVStyle1.TextStyles.Items[RVStyle1.TextStyles.Count].Size = 50

then

>         ShowMessage('"RVStyle1.TextStyles.Count" indicate last item!');

>

> Please, Please Help me!

>

> Regards

>

>

> "Sergey Tkachenko" <[email protected]> wrote:

> >Last added style has index = RVStyle1.TextStyles.Count-1, not

> >RVStyle1.TextStyles.Count

> >(see your call of ApplyTextStyle method)

> >

> >> I dont know is Am I forgot a thing or there is a bug in TRichView!

> >>

> >

> >

> >

>





Powered by ABC Amber Outlook Express Converter