Rank: Member
Groups: Registered
Joined: 2/6/2018(UTC) Posts: 11  Location: Paris Thanks: 6 times
|
Hi, I'm trying to get this function in static but it doesn't seems to be the solution: Code: private void zoomRecherche(List<Point> coordSearched, int iSearch)
{
this.pdfViewer.Zoom = 1.5f;
pdfViewer.ScrollToPoint(pdfToolBarPages.PdfViewer.CurrentIndex, coordSearched[iSearch]);
//pdfViewer.CurrentIndex = pdfToolBarPages.PdfViewer.CurrentIndex;
//pdfViewer.ScrollToPage(pdfToolBarPages.PdfViewer.CurrentIndex);
//pdfViewer.ScrollToChar(coordSearched[1]);
}
But when i put public void zoomRecherche(List<Point> coordSearched, int iSearch), and delete the first thisi get errors messages with pdfViewer and pdfToolBarPages (which depend on pdfViewer). How can i do to use this function on an other form? Thanx. Edited by user Monday, March 5, 2018 5:58:41 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Hi, You should provide an instance of your pdfViewer to static method (as well as all other non-static objects). Code:
public static void zoomRecherche(List<Point> coordSearched, int iSearch, PdfViewer myViewer)
{
myViewer.Zoom = 1.5f;
myViewer.ScrollToPoint(myViewer.CurrentIndex, coordSearched[iSearch]);
}
Now you can call your method Code:
YourClass.zoomRecherche(coordSearched, iSearch, this.pdfViewer);
Edited by user Monday, March 5, 2018 8:59:30 PM(UTC)
| Reason: Not specified
|
 1 user thanked Paul Rayman for this useful post.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 2/6/2018(UTC) Posts: 11  Location: Paris Thanks: 6 times
|
|
|
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close