Click here to Skip to main content
15,881,561 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
VB
' 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)


VB
'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) 'img.Height)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900