Page 1 of 1

What event is better to get the total of page of my doc?

Posted: Thu Jan 26, 2012 3:01 pm
by alexandreq
Hello

I have a status bar and when I open my table and the text is displayed in my DBSRichViewEdit1, I want to inform in the statusbar the current page and total pages of my doc.

I tried to put this code in several places:

afterscroll of my table
OnLoadDocument
OnEnter

But it didn't work and only work when I click on the DBSRichViewEdit1.

StatusBar1.Panels[1].Text := 'Pág: ' + IntToStr(DBSRichViewEdit1.CurrentPage) + '/' + IntToStr(DBSRichViewEdit1.PageCount)


It only display correct when I click on the DBSRICh because it is trigger the event Onenter.

But if I scroll my records, I want to inform the page total of each doc.

Where is it the better place?

Thanks

Posted: Thu Jan 26, 2012 7:49 pm
by Sergey Tkachenko
SBSRichViewEdit.OnCurrentPageChange event

Posted: Fri Jan 27, 2012 10:59 am
by alexandreq
Sergey

I inserted the code on the event and it didn't work as it should work.

I prepared an simple example with dabatase in access and some rows.
Please, take a look at it and tell me how to do this:

http://www.infosoftlanguages.com/arquivos/editorg.zip


How to do:

1) When I open my table and the doc is displayed, I want to show the total of pages that the doc has.

2) When I scroll my table with dbnavigator, when the text is displayed, it must inform the total of pages.

Another thing that I notice and I don't know how to do.

When I scroll my doc with mouse wheel, and the pages are changed, I need to inform what page of the doc I am. like this:

pag 2/4 or pag: 3/5 etc

Please, return my example changed so that I can see what were changed.

thanks my friend
Alex