PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Aug 18, 2017 8:19 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Jun 13, 2017 10:19 am 
Offline

Joined: Tue Jun 13, 2017 10:16 am
Posts: 3
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 13, 2017 12:35 pm 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2689
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 13, 2017 8:28 pm 
Offline

Joined: Tue Jun 13, 2017 10:16 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 14, 2017 7:42 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2689
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 14, 2017 8:55 am 
Offline

Joined: Tue Jun 13, 2017 10:16 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 14, 2017 11:32 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2689
Location: Cologne, Germany
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".

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], williams3, Yahoo [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group