WP7备注(17)(TextBlock和Inlines)
2011-04-28 14:44 血糯米Otomii 阅读(553) 评论(0) 编辑 收藏 举报Code实例:
TextBlock textBlock = new TextBlock(); Run run = new Run(); textBlock.Inlines.Add(run);
Xaml实例:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <TextBlock FontSize="24"> <Run FontFamily="Arial">Arial</Run><LineBreak /> <Run FontFamily="Arial Black">Arial Black</Run><LineBreak /> <Run FontFamily="Calibri">Calibri</Run><LineBreak /> <Run FontFamily="Comic Sans MS">Comic Sans MS</Run><LineBreak /> <Run FontFamily="Courier New">Courier New</Run><LineBreak /> <Run FontFamily="Georgia">Georgia</Run><LineBreak /> <Run FontFamily="Lucida Sans Unicode">Lucida Sans Unicode</Run><LineBreak /> <Run FontFamily="Portable User Interface">Portable User Interface</Run><LineBreak /> <Run FontFamily="Segoe WP">Segoe WP</Run><LineBreak /> <Run FontFamily="Segoe WP Black">Segoe WP Black</Run><LineBreak /> <Run FontFamily="Segoe WP Bold">Segoe WP Bold</Run><LineBreak /> <Run FontFamily="Segoe WP Light">Segoe WP Light</Run><LineBreak /> <Run FontFamily="Segoe WP Semibold">Segoe WP Semibold</Run><LineBreak /> <Run FontFamily="Segoe WP SemiLight">Segoe WP SemiLight</Run><LineBreak /> <Run FontFamily="Tahoma">Tahoma</Run><LineBreak /> <Run FontFamily="Times New Roman">Times New Roman</Run><LineBreak /> <Run FontFamily="Trebuchet MS">Trebuchet MS</Run><LineBreak /> <Run FontFamily="Verdana">Verdana</Run><LineBreak /> <Run FontFamily="Webdings">Webdings</Run> (Webdings) </TextBlock> </Grid>