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 Apply & Save User Settings is at
- ' http://pastebin.com/ycjj5dZK
- ' App's Visual Basic .NET code is at http://pastebin.com/u/jaybeeoh
- ' Video tutorial at YouTube: http://www.youtube.com/user/bolenpresents
- '-------------------------------------------------------------------------------------------
- ' In Project's settings:
- ' Name Type Scope Value
- ' FormSize System.Drawing.Size User 0,0
- ' FormLocation System.Drawing.Point User 0,0
- ' ForeColor System.Drawing.Color User Black
- ' Font System.Drawing.Font User Calibri, 12pt
- #Region " MainForm Events"
- ' Form loads and initialization performed.
- Private Sub MainForm_Load(sender As Object, e As EventArgs) _
- Handles MyBase.Load
- ' NOTE: Additional code not shown.
- ' Retrieve and apply user settings.
- ApplySettings()
- End Sub
- ' Upon form closing, save user settings and check if document has changed.
- Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) _
- Handles Me.FormClosing
- SaveSettings()
- If SaveChanges() Then
- SaveToolStripMenuItem_Click(sender, e)
- End If
- End Sub
- #End Region
- #Region " Settings"
- #Region " ApplySettings"
- Private Sub ApplySettings()
- If My.Settings.FormSize <> Drawing.Size.Empty Then
- Me.Size = My.Settings.FormSize
- End If
- If My.Settings.FormLocation <> Drawing.Point.Empty Then
- Me.Location = My.Settings.FormLocation
- End If
- If My.Settings.ForeColor <> System.Drawing.Color.Empty Then
- MyTextBox.ForeColor = My.Settings.ForeColor
- End If
- If (My.Settings.Font.Name <> String.Empty) AndAlso (My.Settings.Font.Size <> 0) Then
- MyTextBox.Font = My.Settings.Font
- End If
- End Sub
- #End Region
- #Region " SaveSettings"
- Private Sub SaveSettings()
- If Me.WindowState = FormWindowState.Normal Then
- My.Settings.FormSize = Me.Size
- Else
- ' If the form was maximized or minimized,
- ' return to the restore state
- My.Settings.FormSize = Me.RestoreBounds.Size
- End If
- My.Settings.FormLocation = Me.Location
- My.Settings.ForeColor = MyTextBox.ForeColor
- My.Settings.Font = MyTextBox.Font
- My.Settings.Save()
- End Sub
- #End Region
- #End Region
Advertisement
Add Comment
Please, Sign In to add comment