Tag: 粗体

使特定文本在文本框中粘贴

您好,我目前有一个texbox打印出信息给用户,当他们按diffrentbutton。 我想知道是否有办法让我的一些文本粗体,而其余的不是。 我曾试过以下几点: textBox1.FontWeight = FontWeights.UltraBold; textBox1.Text. = ("Your Name: " ); TextBox1.FontWeight = FontWeights.Regular; textBox1.Text += (nameVar); 唯一的问题是使用这种方式将使所有的事情变得粗暴或无所作为。 有没有办法做到这一点? 即时通讯使用C#中的WPF项目 任何意见或build议表示赞赏。 谢谢! 编辑:所以现在即时试图做你所有build议的RichText框,但我似乎无法得到任何东西出现在它: // Create a simple FlowDocument to serve as the content input for the construtor. FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("Simple FlowDocument"))); // After this constructor is called, the new RichTextBox […]