page count sync
page count sync
I have navigation which allows useres to click on right or left arrows to move through pages of pdf files loaded in a gdviewer. Below the arrows is a paging indicator - Page 2 of 48 for example. This works very well and moves through the PDF perfectly. We have recently added the thumbnail viewer which also allows movement of the pages. I am trying to sync the current page of the gdviewer with the paging indicator.
running the newest version of gdpicture .net 8 as com in Microsoft Access 2010.
I have the following two routines for this purpose. Its close but the paging always shows the previous page I clicked on in the thumbnail and not the one currently displayed in the gdviewer or thumbnail?
Private Sub thumb1_ItemClicked(ByVal idx As Long, ByVal button As MouseButton)
Call Display_page
End Sub
Private Sub Display_page()
lbPage.Caption = "Page " & GdViewer1.CurrentPage & " of " & GdViewer1.PageCount
End Sub
running the newest version of gdpicture .net 8 as com in Microsoft Access 2010.
I have the following two routines for this purpose. Its close but the paging always shows the previous page I clicked on in the thumbnail and not the one currently displayed in the gdviewer or thumbnail?
Private Sub thumb1_ItemClicked(ByVal idx As Long, ByVal button As MouseButton)
Call Display_page
End Sub
Private Sub Display_page()
lbPage.Caption = "Page " & GdViewer1.CurrentPage & " of " & GdViewer1.PageCount
End Sub
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: page count sync
Hi,
The reason for that is simple, as a design, the thumbnail index counting starts from 0, and the page numbering starts from 1.
Best Regards,
Sami
The reason for that is simple, as a design, the thumbnail index counting starts from 0, and the page numbering starts from 1.
Best Regards,
Sami
Re: page count sync
Good thought but not the problem. Here is an example. I have a 10 page doument. I click on a thumbnail for page 1, it shows page 1 in the viewer. I click on page 5, it shows page 5 in the viewer but the page indicator is 1 of 10. I click on page 8, it shows page 8 in the viewer but the page indicator shows page 5 of 10.
it always gives me the previous page selected in the thumbnail. its not a zero based paging problem.
it always gives me the previous page selected in the thumbnail. its not a zero based paging problem.
Re: page count sync
Hello,
The ItemCLicked event is fired before the GdViewer page change. So you have to catch the ItemSelectionChanged or the MouseUp event.
Regards,
Loïc
The ItemCLicked event is fired before the GdViewer page change. So you have to catch the ItemSelectionChanged or the MouseUp event.
Regards,
Loïc
Re: page count sync
Just and FYI itemselectionchanged and mouseup produced the same results. I altered the setting of the label to the following procedure which works great.
Thanks for the guidance!
Private Sub thumb1_ItemClicked(ByVal Idx As Long, ByVal Button As MouseButton)
lbPage.Caption = "Page " & Idx + 1 & " of " & GdViewer1.PageCount
End Sub
Thanks for the guidance!
Private Sub thumb1_ItemClicked(ByVal Idx As Long, ByVal Button As MouseButton)
lbPage.Caption = "Page " & Idx + 1 & " of " & GdViewer1.PageCount
End Sub
Who is online
Users browsing this forum: Majestic-12 [Bot] and 1 guest