Need to scroll one WPF Grid

2020-02-11 08:53发布

问题:

I want to create two grids in the WPF Page. One Grid need scrollbar or scroll viewer. Another Grid is static.The grids are placed one by one in the page. How can I create and set the scroll in first Grid?

回答1:

<ScrollViewer>  
    <StackPanel>  
        ...   
    </StackPanel>  
</ScrollViewer>  


回答2:

Sounds like this user justs wants the first grid to scroll, such as:

<StackPanel>
    <ScrollViewer>
        <Grid>
        </Grid>
    </ScrollViewer>
    <Grid>
    </Grid>
</StackPanel>


标签: wpf scroll grid