问一些很基本的问题,本人接触TX 时间很短
1,如何设置当前文本的行距为一倍,1.5倍,2倍2,如何在当前文本中添加一条水平线
3,如何在增大,减小字体,增高降低 字体
4. 如何增大,减小缩进。
问题比较多,非常感谢。 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;//左缩进
回复 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;
回复 2# forachange 的帖子
:strong: 感谢 forachange 的解答~回复 4# iceman 的帖子
问题已经解决,非常感谢回答,真的,非常感谢。!回复 2# forachange 的帖子
感谢 forachange ,非常感谢你们这么用心。回复 5# gaishitaibao 的帖子
应该做的,不客气哈~ 不客气,互相帮忙回复 8# forachange 的帖子
:strong:鉴定为推荐帖,膜拜 forachange
页:
[1]