C# 有没有办法更改文档中一批文本的字体大小
我有一堆文本需要更改字体大小。我想要的文本块位于文档的中间。 所以现在,我所做的是下面。我一直收到一些不改变字体大小的文本。有更好的方法吗?我试着逐字逐句地讲,但这显然需要很长时间才能完成。还尝试通过C# 有没有办法更改文档中一批文本的字体大小,c#,txtextcontrol,C#,Txtextcontrol,我有一堆文本需要更改字体大小。我想要的文本块位于文档的中间。 所以现在,我所做的是下面。我一直收到一些不改变字体大小的文本。有更好的方法吗?我试着逐字逐句地讲,但这显然需要很长时间才能完成。还尝试通过txcontrollobj.find方法查找全文时,会出现内存不足的错误 // processedText is the block that needs to have the changed font size while (processedText != Stri
txcontrollobj.find
方法查找全文时,会出现内存不足的错误
// processedText is the block that needs to have the changed font size
while (processedText != String.Empty)
{
if (processedText.Length > 50)
processRange = 50;
else
processRange = processedText.Length;
startPos = TxControlObj.Find(processedText.Substring(0, processRange), startPos, TXTextControl.FindOptions.NoMessageBox);
TxControlObj.Selection.FontSize = fontSize;
processedText = processedText.Remove(0, processRange);
}
//This last bit here is because, I get highlighted text at the end of the loop otherwise.
startPos = TxControlObj.Find("", startPos, TXTextControl.FindOptions.NoMessageBox);
TxControl.Update();