找回密码
 立即注册

QQ登录

只需一步,快速开始

prodicom

注册会员

4

主题

10

帖子

82

积分

注册会员

积分
82

活字格认证

最新发帖
prodicom
注册会员   /  发表于:2011-12-31 08:56  /   查看:4718  /  回复:1
关于底格线和选打代码何时会有,要不先给点思路!

1 个回复

正序浏览
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2011-12-31 09:32:00
沙发

回复 1# prodicom 的帖子

关于选打我写了一个比较粗略的实现方法,需要细化:
  1.         private void Button_Click(object sender, EventArgs e)
  2.         {
  3.             TXTextControl.Line currLine = textControl1.Lines.GetItem(textControl1.InputPosition.TextPosition);
  4.             TXTextControl.Line firstLine = textControl1.Lines.GetItem(textControl1.GetPages().GetItem().Start);
  5.             int fromPage = currLine.Page;
  6.             int toPage = textControl1.Pages;

  7.             textControl1.Selection.Start = firstLine.Start - 1;
  8.             textControl1.Selection.Length = currLine.Start + currLine.Length - firstLine.Start;
  9.             textControl1.Selection.Text = "";
  10.             
  11.             textControl1.Tables.Add(1, 1, 100);

  12.             TXTextControl.Table table = textControl1.Tables.GetItem(100);
  13.             table.Rows.GetItem(1).MinimumHeight = currLine.TextBounds.Top + currLine.TextBounds.Height - firstLine.TextBounds.Top;
  14.             table.Cells.GetItem(1, 1).Text = "   ";            

  15.             PrintDocument myPrintDocument = new PrintDocument();
  16.             myPrintDocument.PrinterSettings.PrintRange = PrintRange.SomePages;
  17.             myPrintDocument.PrinterSettings.FromPage = fromPage;
  18.             myPrintDocument.PrinterSettings.ToPage = toPage;            
  19.             textControl1.Print(myPrintDocument);
  20.         }
复制代码
我使用的TX17.0 forWinForms 和 C#,如果你不是C#语言需要进行相应的代码转化。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部