WPF 中的简单(我认为)水平线? [英] Simple (I think) Horizontal Line in WPF?
本文介绍了WPF 中的简单(我认为)水平线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
创建一个相对简单的数据输入表单,并且只想用一条水平线(与 HTML 中的 HR 标记不同)分隔某些部分,该线可拉伸表单的全长.
Creating a relatively simple data entry form, and just want to separate certain sections with a horizontal line (not unlike an HR tag in HTML) that stretches the full length of the form.
我已经试过了:
<Line Stretch="Fill" Stroke="Black" X2="1"/>
因为父控件的宽度不是固定的,所以这条线会导致窗口拉伸到屏幕的全宽.
Because the parent control is not a fixed width, this line causes the window to stretch to the full width of the screen.
是否有一种简单的方法可以在不固定父控件/窗口的宽度的情况下执行此操作?
Is there an easy way to do this without fixing the width of my parent control/window?
推荐答案
如何将其添加到您的 xaml 中:
How about add this to your xaml:
<Separator/>
这篇关于WPF 中的简单(我认为)水平线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文