你好,可以用这种方式,用Frames来获取所有的Frame,然后来判断是否是TextFrame
- foreach(FrameBase fb in _textControl.TextParts.GetMainText().Frames)
- {
- if(fb is TextFrame)
- {
- TextFrame tf = (TextFrame)fb;
- foreach (Paragraph ph in tf.Paragraphs)
- {
- tf.Selection.Start = ph.Start - 1;
- tf.Selection.Length = ph.Length;
- tf.Selection.FontSize = 400;
- }
- }
- }
复制代码 |