如何在WPF中实现Scrollviewer(HScroll栏)的功能 [英] How to implement functionality for Scrollviewer (HScroll bar) in WPF

查看:134
本文介绍了如何在WPF中实现Scrollviewer(HScroll栏)的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi All,

I am working in WPF Application, which displays a window, I need to provide scroll bar in my window(because it can't fit textual content) a Horizontal Scrollbar is desirable.


 Collapse | Copy Code
<ScrollViewer Height="203" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Grid.Row="0" Grid.Column="0" Margin="5,5,5,5">
    <wfi:WindowsFormsHost >
        <wf:DataGridView x:Name="dataGridView1" >
        </wf:DataGridView>
    </wfi:WindowsFormsHost>
</ScrollViewer>

but on implementing above code I am unable to obtain scrollbar(Horizontal as well as vertical scrollbar), screen displays, a block of width =200 instead has HSCROLL?
how can I use scrollviewer to implement scrollbar in my module.
Also, implementing HorizontalScrollbarVisibility as mentioned below, had the same effect.

<ScrollViewer  Width="200" HorizontalScrollBarVisibility="Auto" Grid.Column="0" Margin="0,0,0,5">
    <wfi:WindowsFormsHost>
        <wf:DataGridView x:Name="dataGridView2">
        </wf:DataGridView>
    </wfi:WindowsFormsHost>
</ScrollViewer>

推荐答案

肯定是当天的课程分配!第三人有同样的问题...

在这里,您可以:使用以下方法实现滚动条(HSCROLL/VSCROLL) Scrollviewer [ ^ ]
Surely a class assignment of the day! 3rd Person with same question...

Here you go: Implementing Scrollbar(HSCROLL/VSCROLL) using Scrollviewer[^]


这篇关于如何在WPF中实现Scrollviewer(HScroll栏)的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆