logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
bcpletcher  
#1 Posted : Friday, July 21, 2017 7:05:07 AM(UTC)
Quote
bcpletcher

Rank: Newbie

Groups: Registered
Joined: 7/21/2017(UTC)
Posts: 5
United States
Location: Michigan

Thanks: 1 times
I am trying to figure out how to only display a single page at a time and when the user scrolls using a mouse, it scrolls through full page views (Not showing partials as you scroll up).

I was advised to do this in an email "You can call ScrollToPage method or increment/decrement CurrentPageIndex property". Is there any documentation on how to actually implement that and use it for C# WPF applications.
Paul Rayman  
#2 Posted : Sunday, July 23, 2017 7:23:28 PM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
XAML:

Code:

<ScrollViewer Grid.Row="1" CanContentScroll="True"  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
    <Wpf:PdfViewer Name="pdfViewer1" ViewMode="SinglePage" SizeMode="FitToSize" MouseWheel="pdfViewer1_MouseWheel" />
</ScrollViewer>


code behind:
Code:

private void pdfViewer1_MouseWheel(object sender, MouseWheelEventArgs e)
{
	var doc = pdfViewer1.Document;
	if (doc == null)
		return;

	if (e.Delta < 0 && pdfViewer1.CurrentIndex < doc.Pages.Count)
		pdfViewer1.CurrentIndex++;
	else if (e.Delta > 0 && pdfViewer1.CurrentIndex > 0)
		pdfViewer1.CurrentIndex--;

}
bcpletcher  
#3 Posted : Monday, July 24, 2017 6:02:26 AM(UTC)
Quote
bcpletcher

Rank: Newbie

Groups: Registered
Joined: 7/21/2017(UTC)
Posts: 5
United States
Location: Michigan

Thanks: 1 times
This worked perfectly. Thank you for your help!
Quick Reply Show Quick Reply
Users browsing this topic
Guest (2)
New Topic Post Reply
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.