我正在开发WPF应用程序(一个笔记克隆,称为记录您的生活"),您可以在其中动态地将标签分配给条目(就像现在几乎在任何Web 2.0应用程序中一样).为此,我在Windows窗体原型中拥有一个FlowLayoutPanel原型,可以很好地完成这项工作.如果空间不足,我想让标签浮动到下一行,并在需要时获取滚动条.
I am working on a WPF application (a one note clone which is called "note your life") where you can dynamically assign Tags to an entry (just as in virtually any web 2.0 app these days). for this I had in my windows forms prototype a FlowLayoutPanel that did the job very well. I want to have the tags float to the next line if there isn't enough space and get a scrollbar if needed.
如何使用WPF做到这一点?我玩过
How can this be achieved with WPF? I played around with
<StackPanel Orientation="Horizontal" FlowDirection="LeftToRight" ...>但是如果需要的话,这不会移动下一行中的元素.
but this doesn't move the elements in the next line if needed.
推荐答案也许包装面板会有所帮助.
<WrapPanel Orientation="Horizontal"> <Button Margin="3">Button 1</Button> <Button Margin="3">Button 2</Button> <Button Margin="3">Button 3</Button> <Button Margin="3">Button 4</Button> <Button Margin="3">Button 5</Button> </WrapPanel>更多推荐
FlowLayoutPanel的WPF等效项是什么?
发布评论