WPF 列表框两个并排的项目
基本上我想创建一个表单。完成后可能会有点长,所以我想使用列表框,以便表单可以滚动。我想要一个标签,旁边有一个文本框,供用户输入。如何在列表框中并排显示标签和文本框?
另外,如果有人对如何创建表单有任何其他建议,请告诉我。
Basically I want to create a form. It might be a little long after I am done so I wanted to use a list box so the form is scrollable. I would like to have a label with a text box next to it for input from the user. How can I have the label and text box side by side in the list box?
Also, if anyone has any other suggestions on how to create a form please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要使用 ListBox 来添加滚动功能,而应使用 ScrollViewer。
你能画一张图来解释你的想法吗?
还有很多其他选择。例如,在我的示例中,您可以将 ScrollViewer 放在 Border 内。这将使边框的内容而不是整个表单可滚动。关键是确定您希望它的外观以及您希望它的行为方式。
最好的方法是在 Expression Blend 等设计器中进行绘图或原型设计。
Do not use a ListBox to add scrolling capability, use the ScrollViewer for that.
Could you sketch/draw an image that explains your ideas?
There are many other options. E.g., you could put the ScrollViewer inside the Border in my example. That would make the content of the Border scrollable instead of the entire form. Key is to determine what you want it to look like and how you want it to behave.
The best way to do that is by drawing or prototyping in a designer such as Expression Blend.
将包含面板(例如网格)包裹在 ScrollViewer 中 - http://msdn.microsoft .com/en-us/library/ms750665.aspx
Wrap your containing panel (e.g. Grid) in a ScrollViewer - http://msdn.microsoft.com/en-us/library/ms750665.aspx