How to hide vertical PDFViewWPF scrollbar in version 6.2.1.23937?

How to hide vertical PDFViewWPF scrollbar in version 6.2.1.23937?

In XAML
<PDFTron:PDFViewWPF x:Name="pdfView" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"> does not work.

Thanks

Hi Luděk,

Currently, we haven’t added support for those types of properties. We will add this for future releases.In the meantime, you can remove them by travelling through the UI tree and finding them.

The following function will hide the ScrollBars for the current Canvas (i.e everything in a continuous mode, or the current pages visible in you are in one of the non continues page presentation modes.).

private void HideScrollBars()
{
Object o = Current_View.Content;
Grid mainGrid = o as Grid;
if (mainGrid != null)
{
foreach (object chld in mainGrid.Children)
{
ScrollViewer sv = chld as ScrollViewer;
if (sv != null)
{
sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
sv.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;
}
}
}
}

If in a non continues page presentation mode, this will have to be called after the page has changed. Although this has to be done using the UI dispatcher, so that it happens just after the new ScrollViewer has taken the place of the old on. That is:

void PDFViewWPF_CurrentPageNumberChanged(PDFViewWPF viewer, int currentPage, int totalPages)
{
Current_Main.txtbox_pagenum.Text = currentPage.ToString();
this.Dispatcher.BeginInvoke((System.Action)delegate
{
HideScrollBars();
});
}

Furthermore, you will have to call this HideScrollBars function every time the user changes the page presentation mode, and some other things, such as resizing the control. I recommend testing the app and making sure they always stay hidden. There are several events from the PDFViewWPF which should cover these scenarious.

Best Regards,
Tomas Hofamnn

Thanks a lot Tomas,
everything works fine.

Best Regards,
Luděk Rous