Hi
I don't know why I can't preview the page, this code is from PrintDocument1:
and this code is in Print preview button:Code:Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim horizontalprint As Single Dim verticalprint As Single horizontalprint = e.MarginBounds.Left verticalprint = e.MarginBounds.Top Dim printfont As New Font("arial", 12) Dim lineheightsingle As Single = printfont.GetHeight For listindexinteger As Integer = 0 To Me.StudentList.Items.Count - 1 e.Graphics.DrawString(Me.StudentList.Items(listindexinteger).ToString() & Me.DepartmentList.Items(listindexinteger).ToString() & Me.MarkList.Items(listindexinteger).ToString(), printfont, Brushes.Black, horizontalprint, verticalprint) verticalprint += lineheightsingle Next listindexinteger End Sub
can you see the problem there I tried it before and it works I don't why it doesn't work nowCode:Private Sub printbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles printbtn.Click PrintPreviewDialog1.ShowDialog() End Sub![]()
thanks




Reply With Quote