C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » VB.NET Syntax »

Code How to bring Print Dialog Box


Posted Date: 19 Nov 2008    Resource Type: Code Snippets    Category: VB.NET Syntax
Author: ujjwal kumar adhyaMember Level: Bronze    
Rating: 1 out of 5Points: 7



Public Class Form1
Dim PrintDB As New PrintDialog

Private Sub cmdprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdprint.Click
PrintDB.Document = New System.Drawing.Printing.PrintDocument

If (PrintDB.ShowDialog() = DialogResult.OK) Then
Dim Crlf As String = Chr(13) & Chr(10)

TextBox1.Text = ""
TextBox1.AppendText("printer: " & _
PrintDB.PrinterSettings.PrinterName)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("From page: " & _
PrintDB.PrinterSettings.FromPage)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("To page: " & _
PrintDB.PrinterSettings.ToPage)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("Print Range: " & _
PrintDB.PrinterSettings.PrintRange)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("Copies: " & _
PrintDB.PrinterSettings.Copies)
TextBox1.AppendText(Crlf)
If (PrintDB.PrinterSettings.LandscapeAngle = 90) Then
TextBox1.AppendText("Landscape")
Else
TextBox1.AppendText("portrait")
End If
TextBox1.AppendText(Crlf)
TextBox1.AppendText("allow print to file: " & _
PrintDB.AllowPrintToFile)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("AllowSelection: " & _
PrintDB.AllowSelection)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("Allow Some Pages: " & _
PrintDB.AllowSomePages)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("Print To File: " & _
PrintDB.PrintToFile)
TextBox1.AppendText(Crlf)
TextBox1.AppendText("Show Network: " & _
PrintDB.ShowNetwork)
TextBox1.AppendText(Crlf)
End If
End Sub
End Class



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
VB.NET PROGRAMMER  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Code to validate the email address
Previous Resource: Code How Progressbar works
Return to Discussion Resource Index
Post New Resource
Category: VB.NET Syntax


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use