make it print a good quality?

jithea23

New member
Joined
Aug 27, 2014
Messages
2
Location
philippines
Programming Experience
Beginner
I am currently creating a vb program wherein the user encodes data and save to database, and of course a listview of all the records in the database.. After the user encodes all the data, i created a control wherein the user will select item/s from the listview and click a button "print preview", then another form will pop out containing a draft of an ID with the corresponding data of an employee which has been selected from the listview..

So the problem is, I tried using printform, and even printdocument that prints the content of the print preview form, but unfortunately the output is not good, the text are blurry and pixelated.. Is there any way to make it print a good quality?, or is there any other option aside from printform? I really need help.. God bless:)
 
You should be using a PrintDocument. If it didn;t print clearly then it's because you did it wrong. As you haven't shown us what you did, we can't tell you what's wrong with it.

By the way, why "of course" a ListView? I would suggest that it should probably be a DataGridView rather than a ListView. Are you using multiple views or grouping? If not then definitely a DataGridView.
 
Good day sir!. yes i am using printdocument and here is my "print preview form" Untitled.png

here's my code:
VB.NET:
 Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click


        bmp = New Bitmap(Panel1.Width, Panel1.Height)
        Dim G As Graphics = Graphics.FromImage(bmp)


        Panel1.DrawToBitmap(bmp, Panel1.ClientRectangle)
        G.Dispose()


        PrintDocument1.DefaultPageSettings.Landscape = True
        PrintDocument1.DefaultPageSettings.Margins() = New System.Drawing.Printing.Margins(25, 50, 25, 25)




        PrintDialog1.Document = PrintDocument1
        If PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
            PrintDocument1.Print()
        End If
    End Sub


Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        e.Graphics.DrawImage(bmp, 0, 0)


    End Sub
 
Back
Top