c# - Vertical and Horizontal ScrollBars are not working - WPF -


i have following code:

<dockpanel>         <grid>             <grid.columndefinitions>                 <!--this make control in column of grid take 1/10 of total width-->                 <columndefinition width="1*" />                 <!--this make control in column of grid take 4/10 of total width-->                 <columndefinition width="4*" />                 <!--this make control in column of grid take 4/10 of total width-->                 <columndefinition width="4*" />                 <!--this make control in column of grid take 1/10 of total width-->                 <columndefinition width="1*" />             </grid.columndefinitions>             <grid.rowdefinitions>                 <rowdefinition />             </grid.rowdefinitions>             <border borderbrush="black" borderthickness="1" grid.row="0" grid.column="0">                 <stackpanel>                     <image source="/sample;component/images/1_left.png"/>                     <image source="/sample;component/images/2_left.png"/>                     <image source="/sample;component/images/3_left.png"/>                     <image source="/sample;component/images/4_left.png"/>                 </stackpanel>             </border>             <scrollviewer grid.row="0" grid.column="1">                 <canvas name="canvas1">                     <image name="leftimage"/>                     <image name="lefticon"/>                 </canvas>             </scrollviewer>             <scrollviewer grid.row="0" grid.column="2">                 <canvas name="canvas2">                     <image name="rightimage"/>                     <image name="righticon"/>                 </canvas>             </scrollviewer>             <border borderbrush="black" borderthickness="1" grid.row="0" grid.column="3">                 <stackpanel>                     <image source="/sample;component/images/5_right.png"/>                     <image source="/sample;component/images/6_right.png"/>                     <image source="/sample;component/images/7_right.png"/>                     <image source="/sample;component/images/8_right.png"/>                 </stackpanel>             </border>         </grid>     </dockpanel> 

even though "leftimage" , "rightimage" having more width , height, scroll bars not working. cannot able scroll view complete image. ?

thanks

grid not support scrolling functionality. if want scroll need scrollviewer control. place grid within scrollviewer insted of dockpanel

    <scrollviewer horizontalscrollbarvisibility="visible" verticalscrollbarvisibility="visible"> //your grid </scrollviewer> 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -