473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

sending text to a printer??

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

Mar 28 '07 #1
1 1249
Ron
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

On Mar 28, 6:39 pm, "Ron" <pts4...@yahoo.comwrote:
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

Mar 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MouseHart | last post by:
I have written a small VB program which lists my music files on my computer, but I can't get it to print exactly the way I want it to. The data is viewed on screen in an MSFlexGrid named...
4
by: jimatqsi | last post by:
I am trying to print UPS shipping labels using a Zebra label printer. Apparently these printers have the label form programmed into the firmware and all I have to do is send a particular string of...
1
by: deric | last post by:
Hi! I'm new to VB.net programming on printing a page to a thermal printer (Epson T88IV). I really had a hard time figuring out how to code the printing of a bitmap image and some text, while sending...
0
by: Charles Crawford | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.