I have followed
How to print the content of a RichTextBox control by using Visual Basic .NET or Visual Basic 2005
Altough i wanna keep the class in my program....not creat a dll
So i have made a class called RichTextBoxPrintCtrl.vb
Now i assume that the dll gives the .print to a RTFbox ....
because when i try to use:
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
' Print the content of the RichTextBox. Store the last character printed.
checkPrint = RichTextBoxPrintCtrl1.Print(checkPrint, RichTextBoxPrintCtrl1.TextLength, e)
' Look for more pages
If checkPrint < RichTextBoxPrintCtrl1.TextLength Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
It says that the print is not a member to etc rtfbox...
So how would i do that?
Because if i try
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim RTF_Print As New RichTextBoxPrintCtrl.RichTextBoxPrintCtrl
' Print the content of the RichTextBox. Store the last character printed.
checkPrint = RTF_Print.print(checkPrint, RTB_Solution.TextLength, e)
' Look for more pages
If checkPrint < RTB_Solution.TextLength Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
as expected, it prints white page ....since it becomes a loop...
how would i say
checkPrint = RTB_Solution.RichTextBoxPrintCtrl.RichTextBoxPrintCtrl.print(checkPrint, RTB_Solution.TextLength, e)
if you know what i mean
Thanks!
How to print the content of a RichTextBox control by using Visual Basic .NET or Visual Basic 2005
Altough i wanna keep the class in my program....not creat a dll
So i have made a class called RichTextBoxPrintCtrl.vb
Now i assume that the dll gives the .print to a RTFbox ....
because when i try to use:
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
' Print the content of the RichTextBox. Store the last character printed.
checkPrint = RichTextBoxPrintCtrl1.Print(checkPrint, RichTextBoxPrintCtrl1.TextLength, e)
' Look for more pages
If checkPrint < RichTextBoxPrintCtrl1.TextLength Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
It says that the print is not a member to etc rtfbox...
So how would i do that?
Because if i try
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim RTF_Print As New RichTextBoxPrintCtrl.RichTextBoxPrintCtrl
' Print the content of the RichTextBox. Store the last character printed.
checkPrint = RTF_Print.print(checkPrint, RTB_Solution.TextLength, e)
' Look for more pages
If checkPrint < RTB_Solution.TextLength Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
as expected, it prints white page ....since it becomes a loop...
how would i say
checkPrint = RTB_Solution.RichTextBoxPrintCtrl.RichTextBoxPrintCtrl.print(checkPrint, RTB_Solution.TextLength, e)
if you know what i mean
Thanks!