trichview.com

trichview.support




Re: I dont think so!


Return to index


Author

Message

Mamouri

Posted: 04/29/2003 8:57:10


Hi Sergy!

Thankx for your answer!

But the problem dont solved again!

Let's see my new 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 - 1].Size = 50

then

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



     while DBRichViewEdit1.SearchText('Test', [rvseoDown]) do

           DBRichViewEdit1.ApplyTextStyle(RVStyle1.TextStyles.Count - 1);


I send you sample project to your emial.


Thankx



"Sergey Tkachenko" <[email protected]> wrote in message

news:[email protected]...

> 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