在 Silverlight 中的 TextBlock 后显示一行 [英] Display a line after a TextBlock in Silverlight

查看:22
本文介绍了在 Silverlight 中的 TextBlock 后显示一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Silverlight 4 中处理数据表单,并希望按部分对元素进行分组,每个元素都有一个标题.标题由一个 TextBlock 后跟一条水平线组成.这条线一直延伸到表单的边缘.

I'm working on a dataform in Silverlight 4 and would like to group elements by section, with a title for each. The title consists of a TextBlock followed by a horizontal line. The line runs until the edge of the form.

我已经尝试了以下(来自这个线程:http://forums.silverlight.net/forums/p/77813/183885.aspx),没有成功:

I've tried the following (from this thread: http://forums.silverlight.net/forums/p/77813/183885.aspx), without success:

<StackPanel Orientation="Horizontal"/>
    <TextBlock Text="Section title" />
    <Line X1="0" Y1="0" X2="1" Y2="0" Stretch="Fill" Stroke="Black" />
</StackPanel>

知道为什么这不起作用吗?

Any idea why this isn't working?

谢谢!

推荐答案

如何使用边框代替高度为 1

How about using Border instead with a height of 1

这篇关于在 Silverlight 中的 TextBlock 后显示一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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