FlowLayoutPanel的WPF等效项是什么?

编程入门 行业动态 更新时间:2024-10-24 09:27:29
本文介绍了FlowLayoutPanel的WPF等效项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发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等效项是什么?

本文发布于:2023-10-07 15:30:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469780.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:FlowLayoutPanel   WPF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!