VB.NET - Printing datagridview: How do i centre the PrintTitle and Print Logo on the top page

Asked By kibika on 20-Apr-13 09:41 AM
I am using the code below to display the Title when printing a datagridview. How do i centre the title in the code and the Logo.
 
Thanks in advance

' Draw Print Title
e.Graphics.DrawString(PrintTitle, New Font(dgvDisplay.Font, FontStyle.Bold), Brushes.Black, e.MarginBounds.Left, e.MarginBounds.Top - e.Graphics.MeasureString(PrintTitle, New Font(dgvDisplay.Font, FontStyle.Bold), e.MarginBounds.Width).Height + 10)

'Print Logo
                        Dim img As Image = Image.FromFile("Default.jpg")
                        Dim ImgSize As Size = img.Size
                        e.Graphics.DrawImage(img, e.MarginBounds.Left, e.MarginBounds.Top - 0)