PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

DocumentPreview scrollbars
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3599
Page 1 of 1

Author:  theazgra [ Tue Jun 13, 2017 10:19 am ]
Post subject:  DocumentPreview scrollbars

Hi,
How do I move document preview's scroll bars programatically?

I tried something like this but nothing happened.
Code:
pagePreview.HorizontalScroll.Value += 10;


Thanks

Author:  Thomas Hoevel [ Tue Jun 13, 2017 12:35 pm ]
Post subject:  Re: DocumentPreview scrollbars

Hi!

The DocumentPreview contains a DocumentViewer which has a ScrollViewer. So it can be difficult to find the scrollbar that is visible and actually does something.

I'm talking about the MigraDoc viewer and the WPF build.
I have no clue which preview you're asking about.

Author:  theazgra [ Tue Jun 13, 2017 8:28 pm ]
Post subject:  Re: DocumentPreview scrollbars

I am talking about DocumentPreview for WinForms. Yes I can see scroll bars and move them manually bz dragging them.

I wanted to know if there is a way how to move them programatically, e.g. when user presses down arrow key vertical scrollbar moves down.

Author:  Thomas Hoevel [ Wed Jun 14, 2017 7:42 am ]
Post subject:  Re: DocumentPreview scrollbars

theazgra wrote:
I wanted to know if there is a way how to move them programatically, e.g. when user presses down arrow key vertical scrollbar moves down.
We did nothing to prevent this, so it should be possible.
But I never tried it and I don't have code for it.

Maybe you just have to set the focus to the correct item.

Author:  theazgra [ Wed Jun 14, 2017 8:55 am ]
Post subject:  Re: DocumentPreview scrollbars

I think it is bugged.
Because VerticalScroll.Value and HorizontalScroll.Value, does not correspond to scrollbar position, even if you move them manually value is still the same.

And changing this values does not move them.

Author:  Thomas Hoevel [ Wed Jun 14, 2017 11:32 am ]
Post subject:  Re: DocumentPreview scrollbars

theazgra wrote:
I think it is bugged.
Because VerticalScroll.Value and HorizontalScroll.Value, does not correspond to scrollbar position, even if you move them manually value is still the same.
Class "DocumentPreview" has a "PagePreview" which in turn has those:
Code:
HScrollBar _hScrollBar;
VScrollBar _vScrollBar;

A search for "VerticalScroll" gives no hits in MigraDoc.
I'm not sure what you mean when you mention "VerticalScroll.Value" and "HorizontalScroll.Value".

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/