c# - ScrollViewer wpf - doesn't work -
i have wpf application. in window have textblock contains lot of numbers , each number in it's row. want scrollviewer appear when needed. doesn't work... here code
<scrollviewer cancontentscroll="true" margin="5,25,5,0" grid.row="2" horizontalscrollbarvisibility="auto" > <textblock maxheight="500" height="auto" width="auto" verticalalignment="top" name="textblock_results"/> </scrollviewer>
the text block in scroll viewer not capable of scrolling default. enable scrollviewer perform pixel based scrolling need set can content scroll false.
the visibillity of 2 scroll bars controlled independently. have hidden vertical scroll bar in 1 bellow.
<window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid> <scrollviewer cancontentscroll="false" margin="5,25,5,0" grid.row="2" horizontalscrollbarvisibility="auto" verticalscrollbarvisibility="hidden"> <textblock maxheight="500" height="auto" width="auto" verticalalignment="top" name="textblock_results" text="a"/> </scrollviewer> </grid>
Comments
Post a Comment