Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.StartPosition = FormStartPosition.CenterScreen ' Does this center the form?
ToolTip1.SetToolTip(Label1, "dfasffdf")
End Sub
Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click
stat.Text = "Printing..." 'Status set to printing
prog.Visible = True 'Sweet progress bar become visable
prog.Value = (52) ' Because it looks cool
' Attach the PrintDialog to the PrintDocument Object
PrintDialog1.Document = Me.Schedule
' Show the Print Dialog before printing
If PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Me.Schedule.Print() ' Print the Form
End If
stat.Text = "Ready" 'Status changes to ready... because it's ready
prog.Visible = False 'Bye bye sweet progress bar
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles Schedule.PrintPage
' Make form into a bitmap for slopy printing.. cross your fingers
Dim bmp As New Bitmap(Me.Width, Me.Height)
Me.DrawToBitmap(bmp, New Rectangle(0, 0, Me.Width, Me.Height))
e.Graphics.DrawImage(bmp, 0, -30) ' Cut out title bar to look somewhat prettier
End Sub