Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '------------------------------------------------------------------------------------------
- ' Notice of My Copyright and Intellectual Property Rights
- '
- ' Any intellectual property contained within the program by Joseph L. Bolen remains the
- ' intellectual property of the Joseph L. Bolen. This means that no person may distribute,
- ' publish or provide such intellectual property to any other person or entity for any
- ' reason, commercial or otherwise, without the express written permission of Joseph L. Bolen.
- '
- ' Copyright © 2015. All rights reserved.
- ' All trademarks remain the property of their respective owners.
- '-------------------------------------------------------------------------------------------
- ' Program Name: Text Editor
- '
- ' Author: Joseph L. Bolen
- ' Date Created: Feb 2015
- '
- ' Description: Simple plain text editor program with printing ability.
- '
- ' Documentation is at:
- ' App's screen image is at: http://imgur.com/TzWs9kO
- ' App's screen design time specs at: http://pastebin.com/bhinRQ5d
- ' App's Visual Basic .NET Event Procedures & TODO's is at
- ' http://pastebin.com/UZ4tcEpE
- ' App's Visual Basic .NET code is at http://pastebin.com/u/jaybeeoh
- ' Video tutorial at YouTube: http://www.youtube.com/user/bolenpresents
- '-------------------------------------------------------------------------------------------
- ' File Print option.
- Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) _
- Handles PrintToolStripMenuItem.Click,
- PrintToolStripButton.Click
- With PrintDialog1
- .PrinterSettings = PrintDocument1.PrinterSettings
- .Document = PrintDocument1
- ' Allow the user to select a range of pages to be printed.
- .AllowSomePages = True
- .PrinterSettings.MinimumPage = 1
- .PrinterSettings.MaximumPage = 9999
- .PrinterSettings.FromPage = 1
- .PrinterSettings.ToPage = 9999
- If DialogResult.OK = .ShowDialog() Then
- PrintDocument1.PrinterSettings = .PrinterSettings
- Try
- PrintDocument1.Print()
- Catch ex As InvalidPrinterException
- MessageBox.Show(ex.Message, "Invalid Printer",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error)
- Catch ex As Exception
- MessageBox.Show("There was a problem printing the file." &
- ControlChars.NewLine & ex.Message,
- "Printing File Error",
- MessageBoxButtons.OK,
- MessageBoxIcon.Error)
- End Try
- End If
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment