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

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
bcpletcher Posted: Monday, July 24, 2017 6:02:26 AM(UTC)
 
This worked perfectly. Thank you for your help!
Paul Rayman Posted: Sunday, July 23, 2017 7:23:28 PM(UTC)
 
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 Posted: Friday, July 21, 2017 7:05:07 AM(UTC)
 
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.