Thursday, 15 July 2010

c# - Is there a way to change font size of a batch of text within a document -



c# - Is there a way to change font size of a batch of text within a document -

i have bunch of text needs alter font size. text block want in middle of document.

so right now, below. maintain getting bunches of text not changing font size. there improve way this? tried going word word takes visibly long time complete. trying find whole text via txcontrolobj.find method gets out of memory errors.

// processedtext block needs have 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 lastly bit here because, highlighted text @ end of loop otherwise. startpos = txcontrolobj.find("", startpos, txtextcontrol.findoptions.nomessagebox); txcontrol.update();

c# txtextcontrol

No comments:

Post a Comment