开发者

WPF on a small screen. Needs scrolling function

开发者 https://www.devze.com 2023-01-15 05:17 出处:网络
I have a paged WPF(.Net4) application which is too big for the screen when being used on a netbook. I\'d like to be able to resize and scroll (as we do when using a webpage) but currently all items ou

I have a paged WPF(.Net4) application which is too big for the screen when being used on a netbook. I'd like to be able to resize and scroll (as we do when using a webpage) but currently all items outside of the view are not accessible. I suspect there's probably a simple solution but I just don't know.

Thanks in advance.

UPDATE

The NavigationWindow doesn't support direct content so I have to add the scroll function to each page separately. Is there a better way to do this?

I've added the code below but when the program is resized the scroller doesn't appear. Without the visibility settings it just shows a 'dead' scroller.

 <ScrollViewer CanContentScroll="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

         <StackPanel Margin="0,40,0,0开发者_开发问答" Width="600" Height="500">

            <FlowDocumentPageViewer Height="500">
                <FlowDocument>

                    <Paragraph>CONTENT REMOVED FOR BREVITY</Paragraph>

                </FlowDocument>
            </FlowDocumentPageViewer>

         </StackPanel>

            </ScrollViewer>


Put all your content into a ScrollViewer, that will do it.


Don't forget you can put HorizontalScrollBarVisibility property (same with Vertical) to "Auto", if you want to display the scrollbars only if necessary

0

精彩评论

暂无评论...
验证码 换一张
取 消