gaishitaibao 发表于 2012-5-23 14:24:00

问一些很基本的问题,本人接触TX 时间很短

1,如何设置当前文本的行距为一倍,1.5倍,2倍
2,如何在当前文本中添加一条水平线
3,如何在增大,减小字体,增高降低 字体
4. 如何增大,减小缩进。
问题比较多,非常感谢。

forachange 发表于 2012-5-23 16:24:00

1、设置行距,使用ParagraphFormatParagraphFormat pf = new ParagraphFormat();
            pf.AbsoluteLineSpacing = textControl1.Selection.ParagraphFormat.AbsoluteLineSpacing * 2; //行距
            pf.LeftIndent = 100;//左缩进            
            textControl1.Selection.ParagraphFormat = pf;2、水平线还不清楚怎么增加。

3、使用InputFormat设置 InputFormat inputFormat = textControl1.InputFormat;
            inputFormat.FontSize = inputFormat.FontSize + 10; //改变字号
            //inputFormat.Superscript = true;//上标
            inputFormat.Subscript = true;//下标
            inputFormat.LeftIndent = 140;//左缩进

iceman 发表于 2012-5-24 09:43:00

回复 1# gaishitaibao 的帖子

gaishitaibao 你好,
请参加代码:
1.段落设置
            //段落设置
            TXTextControl.ParagraphFormat paragraphFormat = new TXTextControl.ParagraphFormat();
            //设置行距为当前文本行两倍
            paragraphFormat.LineSpacing = this.textControl1.Selection.ParagraphFormat.LineSpacing * 2;
            //当前段落设置下侧水平线
            paragraphFormat.FrameStyle = TXTextControl.FrameStyle.Single;
            paragraphFormat.Frame = TXTextControl.Frame.BottomLine;
            this.textControl1.Selection.ParagraphFormat = paragraphFormat;
2.字体设置:
            //设置字体
            TXTextControl.InputFormat fontFormat = this.textControl1.InputFormat;
            //设置字体大小
            fontFormat.FontSize = 100;
            //降低字体
            fontFormat.Subscript = true;
            //升高字体
            fontFormat.Superscript = true;

iceman 发表于 2012-5-24 09:44:00

回复 2# forachange 的帖子

:strong: 感谢 forachange 的解答~

gaishitaibao 发表于 2012-5-24 13:56:00

回复 4# iceman 的帖子

问题已经解决,非常感谢回答,真的,非常感谢。!

gaishitaibao 发表于 2012-5-24 13:57:00

回复 2# forachange 的帖子

感谢 forachange ,非常感谢你们这么用心。

iceman 发表于 2012-5-24 14:04:00

回复 5# gaishitaibao 的帖子

应该做的,不客气哈~

forachange 发表于 2012-5-24 17:56:00

不客气,互相帮忙

iceman 发表于 2012-5-25 14:39:00

回复 8# forachange 的帖子

:strong:鉴定为推荐帖,膜拜 forachange
页: [1]
查看完整版本: 问一些很基本的问题,本人接触TX 时间很短