clockwork3orange
Member
- Joined
- Oct 20, 2006
- Messages
- 21
- Programming Experience
- Beginner
Hello all!
I'm working on a barcode project in VB.NET 2005. I'm not a terribly good programmer and need a little help here. What this program does thus far is take input from a text field and passes it to a module where the input is converted into binary and printed as lines to a picture box on the screen. What I would like to do is then print whatever is in the box to a page. I added the print document tool. In the area of the code where the system generated code is I added the following procedure
This doesn’t seem to do anything. I get an error when I try to print and "No pages found" when I try to preview. Any suggestions?
I'm working on a barcode project in VB.NET 2005. I'm not a terribly good programmer and need a little help here. What this program does thus far is take input from a text field and passes it to a module where the input is converted into binary and printed as lines to a picture box on the screen. What I would like to do is then print whatever is in the box to a page. I added the print document tool. In the area of the code where the system generated code is I added the following procedure
VB.NET:
Private Sub btnPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreview.Click
PreviewMe.ShowDialog()
End Sub
Private Sub PrintMe_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintMe.PrintPage
Dim MyGraphicsPage As Graphics = e.Graphics
MyGraphicsPage.PageUnit = GraphicsUnit.Inch
MyGraphicsPage.DrawImage(PictureBox1.Image, 1, 1, PictureBox1.Width, PictureBox1.Height)
End Sub
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
PrintMe.Print()
End Sub
Last edited by a moderator: