Silverlight(6) - 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton
2008-11-14 11:50:44 来源:WEB开发网5、TextBlock.xaml
<UserControl x:Class="Silverlight20.Control.TextBlock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Left">
<!--
Text - TextBlock上显示的值
-->
<TextBlock Text="TextBlock" />
<!--
Foreground - 字体颜色
-->
<TextBlock Text="红色的TextBlock" Foreground="Red" />
<!--
要以XAML的方式直接显示引号等特殊字请使用相应的HTML编码
-->
<TextBlock Text="带引号的"TextBlock"" />
<!--
FontFamily - 字体
FontSize - 字体大小
FontWeight - 字形粗细度 [System.Windows.FontWeights枚举]
FontStyle - 字形斜体否 [System.Windows.FontStyles枚举]
TextDecorations - 字体下划线 [System.Windows.TextDecorations枚举]
FontStretch - 字体间距 [System.Windows.FontStretches枚举]
-->
<TextBlock Text="常用属性TextBlock" FontFamily="宋体" FontSize="36" FontWeight="Bold" FontStyle="Italic" TextDecorations="Underline" FontStretch="Normal" />
<!--
TextAlignment - 文字排列 [System.Windows.TextAlignment枚举]
Run - 文本内容
LineBreak - 换行符
LineHeight - 每行行高
TextWrapping - 文本限制(超过限制是否换行)
NoWrap - 永不换行
Wrap - 超过限制则换行
LineStackingStrategy - 控制行高的策略
MaxHeight - TextBlock内每行的行高 以LineHeight值 和 每行自身所设置的行高值 间的最大值为准
BlockLineHeight - TextBlock内每行的行高 以LineHeight值为准
-->
<TextBlock VerticalAlignment="Center" TextAlignment="Center" LineHeight="10" LineStackingStrategy="MaxHeight" Width="200" TextWrapping="NoWrap">
<Run FontSize="20" Foreground="Maroon" Text="MaroonMaroonMaroonMaroon" />
<LineBreak/>
<Run Foreground="Teal" Text="Teal" />
<LineBreak/>
<Run FontSize="30" Foreground="SteelBlue" Text="SteelBlue" />
</TextBlock>
<TextBlock VerticalAlignment="Center" TextAlignment="Center" LineHeight="10" LineStackingStrategy="BlockLineHeight" Width="200" TextWrapping="Wrap">
<Run FontSize="20" Foreground="Red" Text="RedRedRedRedRedRedRedRedRed" />
<LineBreak/>
<Run Foreground="Green" Text="Green" />
<LineBreak/>
<Run FontSize="30" Foreground="Blue" Text="Blue" />
</TextBlock>
</StackPanel>
</UserControl>
Tags:Silverlight 控件 ScrollViewer
编辑录入:爽爽 [复制链接] [打 印]- ››silverlight全屏显示图片
- ››控件一:Gallery 之无限循环的问题
- ››控件一:Gallery 之基础用法
- ››Silverlight MVVM 模式(一) 切近实战
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››Silverlight3系列(四)数据绑定 Data Binding 1
- ››silverlight2 游戏 1 你能坚持多少秒
- ››Silverlight开发实践--PicZoomShow
- 中查找“Silverlight(6) - 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton”更多相关内容
- 中查找“Silverlight(6) - 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton”更多相关内容
- 上一篇:Silverlight(7) - 2.0图形之Ellipse, Line, Path, Polygon, Polyline, Rectangle
- 下一篇:Silverlight(5) - 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton
更多精彩
赞助商链接