本文介绍了如何在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>

推荐答案


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

10-19 19:23