|
-
Mar 27th, 2009, 01:02 PM
#1
Thread Starter
Stack Overflow moderator
Printing simple
Is there a way to print simple text in Courier New? No pictures, no fancy fonts, it's all the same size, and no margins, etc. Is there a VB.NET function for this?
-
Mar 27th, 2009, 02:11 PM
#2
Re: Printing simple
What do you want to print from?, a RichTextBox? There's a complete example here of printing here;
http://www.vbdotnetheaven.com/Upload...nginVBNET.aspx
You can print in any font supported under "System.Drawing". So if Courier New is there you can print with it.
You can see available fonts using
Code:
Dim MyFonts As System.Drawing.Text.InstalledFontCollection = New _
System.Drawing.Text.InstalledFontCollection
Dim Str As String = String.Empty
For Each fam As FontFamily In MyFonts.Families
Str += fam.Name & " "
Next
MessageBox.Show(Str)
Last edited by Bulldog; Mar 27th, 2009 at 02:17 PM.
-
Mar 27th, 2009, 02:12 PM
#3
Re: Printing simple
you need to add a printdocument to your project.
in the printdocument_printpage event you use drawstring, in which you can specify your font.
try that + if you need any more help ask again
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 27th, 2009, 07:29 PM
#4
Thread Starter
Stack Overflow moderator
Re: Printing simple
 Originally Posted by Bulldog
What do you want to print from?, a RichTextBox? There's a complete example here of printing here;
http://www.vbdotnetheaven.com/Upload...nginVBNET.aspx
You can print in any font supported under "System.Drawing". So if Courier New is there you can print with it.
You can see available fonts using
Code:
Dim MyFonts As System.Drawing.Text.InstalledFontCollection = New _
System.Drawing.Text.InstalledFontCollection
Dim Str As String = String.Empty
For Each fam As FontFamily In MyFonts.Families
Str += fam.Name & " "
Next
MessageBox.Show(Str)
I want to print out simple text in one font. That means no RichTextBoxes.
Thanks, .paul.. I'll try that now.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|