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