首页 文章

如何在wpf中使用带有包装面板的滚动查看器

提问于
浏览
1

单击按钮时,我有一个按钮 . 我动态创建按钮并添加按钮以包裹面板并在窗口中显示它但是如果按钮超出宽度 . 如果我在单击按钮包装面板时未显示滚动查看器内的滚动面板,我想滚动 .

1 回答

  • 2

    基于此解决方案:

    <ScrollViewer VerticalScrollBarVisibility="Hidden" Width ="100" HorizontalScrollBarVisibility="Auto" Margin="76,0,113,213">
       <WrapPanel>
            <Button Content="Press" />
            <Button Content="Press" />
            <Button Content="Press" />
            <Button Content="Press" />
            <Button Content="Press" />
            <Button Content="Press" />
        </WrapPanel>
     </ScrollViewer>
    

相关问题