Спасибо, большое, за внимание! Я тоже решила эту проблему, правда может не очень красиво, но все-же. ' Подключаю файл
| Код | Private Sub mnuPrewievs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrewievs.Click Dim strS As String Dim strD As String Dim nType As Integer = FreeFile() Dim MyFile As StreamReader frmReportTitul.Show() frmReportTitul.MdiParent = Me frmReportTitul.ReportTitul.LoadFile(dlgOpen.FileName, _ RichTextBoxStreamType.RichText) End Sub ' Формирую страницу печати Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim strD As String Dim strV As String ' для считывания одной строчки Dim chL As String ' для считывания одногосимвола Dim Cou As Integer = 1 ' счетчик для строки Dim intCounter As Integer ' счетчик по RichTextBox.Text strV = frmReportTitul.ReportTitul.Text For intCounter = 1 To 88 ' Универсально для самого маленького шрифта на один лист Do If chL <> Chr(10) And chL <> Chr(13) And chL <> "" Then strD = strD & chL End If chL = Mid(strV, Cou, 1) Cou += 1 Loop While chL <> Chr(10) And Cou < Len(strV) If chL = "" Then Exit For End If frmReportTitul.ReportTitul.Find(strD) ' Ищу строку, чтобы считать шрифт SelectionFont 'Оператор для формирования графического объекта e.Graphics.DrawString(strD, frmReportTitul.ReportTitul.SelectionFont(), Brushes.Black, 0, (intCounter - 1) * 18)' *18 - приблизительный интервал между строками strD = "" Next End Sub 'Печатаю Private Sub mnuPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrint.Click PrintDocument1.Print() End Sub
|
Простенько, но работает. P.S. примеры почему-то не открываются. |