WPF顯示文本實現(xiàn)方法介紹
作者:佚名 
  WPF顯示文本是一個比較基礎(chǔ)的相關(guān)操作技巧。作為一個剛剛接觸WPF的學(xué)習(xí)者來說,掌握這一技巧對于以后的學(xué)習(xí)有很大的幫助。
 WPF可以幫助我們輕松實現(xiàn)一些以前比較難實現(xiàn)的功能需求。在這里我們將會體會到WPF顯示文本中的輕松實現(xiàn)方法,來以實例體驗其靈活性。#t#
WPF顯示文本之xaml
- < TextBlock HorizontalAlignment
="Left" Text="豎立顯示文本"
Name="textBlock1" Width="92" /> 
WPF顯示文本之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);
 - }
 
以上就是我們向大家介紹的WPF顯示文本的相關(guān)概念介紹。
責(zé)任編輯:曹凱 
                    來源:
                    博客園
 














 
 
 
 
 
 
 