sending text to a printer??

  • Thread starter Thread starter Ron
  • Start date Start date
R

Ron

I would like to make a program that will print to the printer odd
numbers of an entered number. For example if I enter 14 in the
textbox
I will get a printout like this: 13, 11, 9, 7, 5, 3, 1

How would I go about doing this? I would assume I would use a loop
and
do something like this?..


while text1.text !=0
then mod by 1 and display the answer
loop
 
here is what I have so far:

Imports System.drawing.printing
Public Class Form1

Private Sub prtdocument_PrintPage _
(ByVal sender As System.Object, _
ByVal e As _
System.Drawing.Printing.PrintPageEventArgs) _
Handles prtdocument.PrintPage
'e.Graphics.DrawString(TextBox1.Text), _

Dim font As Font
Dim brush As Brush
Dim height As Integer
Dim outputString As String
font = New Font("Arial", 12)
brush = New SolidBrush(Color.Black)
height = font.Height
outputString = TextBox1.Text

e.Graphics.DrawString(outputString, _
font, brush, 0, height)


++++++++
the new on the line below is blue underlined and says syntax error
++++++++

new Font("Times New Roman", 12, _
FontStyle.Regular), Brushes.Black, 10, 10)
End Sub


Private Sub btnPrint_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnPrint.Click
prtdialog.Document = prtdocument
If prtdialog.ShowDialog() = _
Windows.Forms.DialogResult.OK Then

End If
prtdocument.Print()

End Sub

End Class
 
Back
Top