关于选打我写了一个比较粗略的实现方法,需要细化:- private void Button_Click(object sender, EventArgs e)
- {
- TXTextControl.Line currLine = textControl1.Lines.GetItem(textControl1.InputPosition.TextPosition);
- TXTextControl.Line firstLine = textControl1.Lines.GetItem(textControl1.GetPages().GetItem().Start);
- int fromPage = currLine.Page;
- int toPage = textControl1.Pages;
- textControl1.Selection.Start = firstLine.Start - 1;
- textControl1.Selection.Length = currLine.Start + currLine.Length - firstLine.Start;
- textControl1.Selection.Text = "";
-
- textControl1.Tables.Add(1, 1, 100);
- TXTextControl.Table table = textControl1.Tables.GetItem(100);
- table.Rows.GetItem(1).MinimumHeight = currLine.TextBounds.Top + currLine.TextBounds.Height - firstLine.TextBounds.Top;
- table.Cells.GetItem(1, 1).Text = " ";
- PrintDocument myPrintDocument = new PrintDocument();
- myPrintDocument.PrinterSettings.PrintRange = PrintRange.SomePages;
- myPrintDocument.PrinterSettings.FromPage = fromPage;
- myPrintDocument.PrinterSettings.ToPage = toPage;
- textControl1.Print(myPrintDocument);
- }
复制代码 我使用的TX17.0 forWinForms 和 C#,如果你不是C#语言需要进行相应的代码转化。 |