bandariiswear

幽艳纷相竞 秾纤各自奇 虽然春烂漫 也要笔扶持 清人题画诗

导航

wpf中textblock竖立显示文本

xaml

<TextBlock HorizontalAlignment="Left" Text="竖立显示文本"  Name="textBlock1" Width="92" />

cs

string s = textBlock1.Text;             int a = s.Length;             textBlock1.Text = "";             for (int i = 0; i < a; i++)             {                 Run run = new Run();                 run.Text = s.Substring(i, 1);                 LineBreak lb = new LineBreak();                 textBlock1.Inlines.Add(run);                 textBlock1.Inlines.Add(lb);

            }

 如果是TextBox中没有“Inlines”属性可以增加“LineBreak "..

http://www.cnblogs.com/luckapple2/archive/2009/11/09/1599336.html

posted on 2012-11-02 16:21  YEKEYISHUO  阅读(705)  评论(0编辑  收藏  举报