本文介绍了以编程方式更改字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 这三行在下面定义如何以编程方式更改字体These three line define under below how to change Font programmaticallyArial‘ Change Font / Font SizeThoma‘ Change Font / Font SizeCalibri ‘Change Font / Font Size 我尝试过:What I have tried:RtbBox.Text += Environment.NewLine + "Thoma" RtbBox.Text += Environment.NewLine + "Arial" RtbBox.Text += Environment.NewLine + "Calibiri"RtbBarcodeLinesGenerate.SelectionFont = New Font("Thoma", 16, FontStyle.Regular)RtbBox.SelectionFont = New Font(RtbBox.Font.FontFamily, RtbBox.Font.Size, FontStyle.Bold)推荐答案'lines(0)RichTextBox1.SelectionStart = RichTextBox1.GetFirstCharIndexFromLine(0)RichTextBox1.SelectionLength = RichTextBox1.Lines(0).LengthRichTextBox1.SelectionFont = New Font("Thoma", 16, FontStyle.Regular)'lines(1)RichTextBox1.SelectionStart = RichTextBox1.GetFirstCharIndexFromLine(1)RichTextBox1.SelectionLength = RichTextBox1.Lines(1).LengthRichTextBox1.SelectionFont = New Font("Arial", 14, FontStyle.Bold)'lines(2)RichTextBox1.SelectionStart = RichTextBox1.GetFirstCharIndexFromLine(2)RichTextBox1.SelectionLength = RichTextBox1.Lines(2).LengthRichTextBox1.SelectionFont = New Font("Calibiri", 12, FontStyle.Italic) 以上代码可以转换成程序。请参阅:以编程方式将格式化字体添加到Richtextbox - VB.NET | Dream.In.Code [ ^ ] 祝你好运!Above code can be "converted" into procedure. See: Programatically Add Formatted Font To Richtextbox - VB.NET | Dream.In.Code[^]Good luck! 这篇关于以编程方式更改字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-03 13:55