Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42321

Center Title when printing

$
0
0
I am printing a listview and in the preview it looks fine. But when it actually prints this is what i get. Attachment 95807

This is the code associated in the print code.

Code:

            If title <> "" Then
                Dim tFont As New Drawing.Font(lv.Font.FontFamily, CType(lv.Font.Size * 1.5, Single), FontStyle.Bold)

                Dim r As New Rectangle(startX + CInt(columnSum / 2) - CInt(e.Graphics.MeasureString(title, tFont).Width / 2), startY + 2, CInt(columnSum / 2), tFont.Height)
                e.Graphics.DrawString(title, tFont, Brushes.Black, r)
                startY += tFont.Height + 2
            End If

Im not sure where i fix it so that the title is centered.
Attached Images
 

Viewing all articles
Browse latest Browse all 42321

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>