码迷,mamicode.com
首页 > 其他好文 > 详细

后台添加Textbox

时间:2016-04-08 09:02:50      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

 1         /// <summary>
 2         /// behind add textbox
 3         /// </summary>
 4         private void AddTextToTextBox()
 5         {
 6             TextBlock tb = new TextBlock();
 7             tb.TextWrapping = TextWrapping.Wrap;
 8             tb.Margin = new Thickness(10);
 9             tb.Inlines.Add("An example on ");
10             tb.Inlines.Add(new Run("the TextBlock control ") { FontWeight = FontWeights.Bold });
11             tb.Inlines.Add("using ");
12             tb.Inlines.Add(new Run("inline ") { FontStyle = FontStyles.Italic });
13             tb.Inlines.Add(new Run("text formatting ") { Foreground = Brushes.Blue });
14             tb.Inlines.Add("from ");
15             tb.Inlines.Add(new Run("Code-Behind") { TextDecorations = TextDecorations.Underline });
16             tb.Inlines.Add(".");
17             this.sp_text.Children.Add(tb);
18         }

 

后台添加Textbox

标签:

原文地址:http://www.cnblogs.com/billly/p/5366432.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!