将控件包装在堆栈面板中 [英] Wrapping controls inside a stack panel

查看:101
本文介绍了将控件包装在堆栈面板中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在动态添加一些控件作为子控件到堆栈面板控件中.如果控件不适合一行,我想将控件包装到下一行.我该怎么办?

谢谢

Hi everyone,

I am adding few controls dynamically to a stack panel control as children. I would like to wrap controls to next row if the controls don''t fit in a row. How can I do that?

Thanks

推荐答案

我不认为堆栈面板和您的子控件是采用这种方式设计的.您可以按照容器面板调整内容的方式来设计窗口,或者使用滚动条来使用,这是最适合您的选择.

—SA
I don''t think the stack panel and your child controls are designed this way. You could design the window the way the container panel adjusts to the content or work with scroll bars, whatever suit you the best.

—SA


您可以创建WrapPanel.有关更多信息,请参见 http://www.c-sharpcorner.com/uploadfile/mahesh/wrappanel-in-wpf/ [ ^ ]

乌鲁斯人
You could create a WrapPanel. For more info take a look at http://www.c-sharpcorner.com/uploadfile/mahesh/wrappanel-in-wpf/[^]

Uros


这篇关于将控件包装在堆栈面板中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆