+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visual
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NoteBug
Features
1)...Reader. (Reads only text files)
2)...Regular notepad features
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Codes
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Region "imports"
Imports System
Imports
System.Drawing
Imports
System.Windows.Forms
Imports
System.Runtime.InteropServices
Imports
System.Drawing.Imaging
Imports
System.Drawing.Drawing2D
Imports System.IO
Imports
System.Text.RegularExpressions
Imports
System.Text
Imports SpeechLib
Imports
System.Drawing.Printing
#End Region
Public Class frmNoteBUg
Inherits
System.Windows.Forms.Form
#Region "Privates"
Private
NewMove As fMouseAction
Friend WithEvents panMenu As
System.Windows.Forms.Panel
Friend WithEvents MenuStrip1 As
System.Windows.Forms.MenuStrip
Friend WithEvents FileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents NewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents OpenToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator As System.Windows.Forms.ToolStripSeparator
Friend WithEvents SaveToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SaveAsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents PrintToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ExitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents EditToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents
UndoToolStripMenuItem As
System.Windows.Forms.ToolStripMenuItem
Friend WithEvents RedoToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator3 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents
CutToolStripMenuItem As
System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CopyToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents PasteToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator4 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents SelectAllToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator6 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ReadAllTextToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ReadSelectedTextToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents StopReadingToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents FornateToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents FontToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents FontColourToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SelectedFontColourToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator7 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents FindToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents FindToolStripTextBox3 As System.Windows.Forms.ToolStripTextBox
Friend WithEvents FindAndReplaceToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripTextBox1 As
System.Windows.Forms.ToolStripTextBox
Friend WithEvents ToolStripTextBox2 As
System.Windows.Forms.ToolStripTextBox
Friend WithEvents ToolStripSeparator8 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents HelpToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents Help2ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator5 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents AboutToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CloseHelpToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents panTopSep As
System.Windows.Forms.Panel
Friend WithEvents PrtDoc As
System.Drawing.Printing.PrintDocument
Friend WithEvents lblName As
System.Windows.Forms.Label
Friend WithEvents lblTxtCount As
System.Windows.Forms.Label
Friend WithEvents TbCtrlMain As
System.Windows.Forms.TabControl
Friend WithEvents tbpgNote As
System.Windows.Forms.TabPage
Friend WithEvents TabPage2 As
System.Windows.Forms.TabPage
Friend WithEvents panShaper1 As
System.Windows.Forms.Panel
Friend WithEvents panShaper2 As
System.Windows.Forms.Panel
Friend WithEvents panInfo As
System.Windows.Forms.Panel
Friend WithEvents lblInfo As
System.Windows.Forms.Label
Friend WithEvents btnInfo As
System.Windows.Forms.Button
Friend WithEvents PrtPrvDia As
System.Windows.Forms.PrintPreviewDialog
Friend WithEvents btnSave As
System.Windows.Forms.Button
Private
NewSize As fResizeableControl
#End Region
#Region "Windows Form Generated Codes"
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
'Form overrides
dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub
Dispose(ByVal disposing As Boolean)
Try
If
disposing AndAlso components IsNot Nothing Then
components.Dispose()
End
If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the
Windows Form Designer
Private
components As System.ComponentModel.IContainer
'NOTE: The
following procedure is required by the Windows Form Designer
'It can be
modified using the Windows Form Designer.
'Do not modify it
using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim
resources As System.ComponentModel.ComponentResourceManager
= New
System.ComponentModel.ComponentResourceManager(GetType(frmNoteBUg))
Me.panBother_T
= New System.Windows.Forms.Panel
Me.panTop
= New System.Windows.Forms.Panel
Me.lblName
= New System.Windows.Forms.Label
Me.panMenu
= New System.Windows.Forms.Panel
Me.MenuStrip1
= New System.Windows.Forms.MenuStrip
Me.FileToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.NewToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.OpenToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.toolStripSeparator
= New System.Windows.Forms.ToolStripSeparator
Me.SaveToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.SaveAsToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.toolStripSeparator1
= New System.Windows.Forms.ToolStripSeparator
Me.PrintToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.toolStripSeparator2
= New System.Windows.Forms.ToolStripSeparator
Me.ExitToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.EditToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.UndoToolStripMenuItem = New
System.Windows.Forms.ToolStripMenuItem
Me.RedoToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.toolStripSeparator3
= New System.Windows.Forms.ToolStripSeparator
Me.CutToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.CopyToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.PasteToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.toolStripSeparator4
= New System.Windows.Forms.ToolStripSeparator
Me.SelectAllToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripSeparator6
= New System.Windows.Forms.ToolStripSeparator
Me.ReadAllTextToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.ReadSelectedTextToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.StopReadingToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.FornateToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.FontToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.FontColourToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.SelectedFontColourToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripSeparator7
= New System.Windows.Forms.ToolStripSeparator
Me.FindToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.FindToolStripTextBox3
= New System.Windows.Forms.ToolStripTextBox
Me.FindAndReplaceToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripTextBox1
= New System.Windows.Forms.ToolStripTextBox
Me.ToolStripTextBox2
= New System.Windows.Forms.ToolStripTextBox
Me.ToolStripSeparator8
= New System.Windows.Forms.ToolStripSeparator
Me.HelpToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.Help2ToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripSeparator5
= New System.Windows.Forms.ToolStripSeparator
Me.AboutToolStripMenuItem
= New System.Windows.Forms.ToolStripMenuItem
Me.CloseHelpToolStripMenuItem1
= New System.Windows.Forms.ToolStripMenuItem
Me.panMini
= New System.Windows.Forms.Panel
Me.panMaxi
= New System.Windows.Forms.Panel
Me.panClose
= New System.Windows.Forms.Panel
Me.panxOS
= New System.Windows.Forms.Panel
Me.panBother_R
= New System.Windows.Forms.Panel
Me.panBother_L
= New System.Windows.Forms.Panel
Me.panBother_B
= New System.Windows.Forms.Panel
Me.rtbxNote
= New System.Windows.Forms.RichTextBox
Me.panBottom
= New System.Windows.Forms.Panel
Me.lblTxtCount
= New System.Windows.Forms.Label
Me.panTopSep
= New System.Windows.Forms.Panel
Me.PrtDoc
= New System.Drawing.Printing.PrintDocument
Me.TbCtrlMain
= New System.Windows.Forms.TabControl
Me.tbpgNote
= New System.Windows.Forms.TabPage
Me.panShaper2
= New System.Windows.Forms.Panel
Me.panShaper1
= New System.Windows.Forms.Panel
Me.TabPage2
= New System.Windows.Forms.TabPage
Me.panInfo
= New System.Windows.Forms.Panel
Me.btnSave
= New System.Windows.Forms.Button
Me.lblInfo = New
System.Windows.Forms.Label
Me.btnInfo
= New System.Windows.Forms.Button
Me.PrtPrvDia
= New System.Windows.Forms.PrintPreviewDialog
Me.panTop.SuspendLayout()
Me.panMenu.SuspendLayout()
Me.MenuStrip1.SuspendLayout()
Me.panBottom.SuspendLayout()
Me.TbCtrlMain.SuspendLayout()
Me.tbpgNote.SuspendLayout()
Me.TabPage2.SuspendLayout()
Me.panInfo.SuspendLayout()
Me.SuspendLayout()
'
'panBother_T
'
Me.panBother_T.BackColor
= System.Drawing.Color.Black
Me.panBother_T.Dock
= System.Windows.Forms.DockStyle.Top
Me.panBother_T.Location
= New System.Drawing.Point(0, 0)
Me.panBother_T.Name
= "panBother_T"
Me.panBother_T.Size
= New System.Drawing.Size(655, 3)
Me.panBother_T.TabIndex
= 0
'
'panTop
'
Me.panTop.BackColor
= System.Drawing.Color.Black
Me.panTop.Controls.Add(Me.lblName)
Me.panTop.Controls.Add(Me.panMenu)
Me.panTop.Controls.Add(Me.panMini)
Me.panTop.Controls.Add(Me.panMaxi)
Me.panTop.Controls.Add(Me.panClose)
Me.panTop.Controls.Add(Me.panxOS)
Me.panTop.Dock
= System.Windows.Forms.DockStyle.Top
Me.panTop.Location
= New System.Drawing.Point(3, 3)
Me.panTop.Name
= "panTop"
Me.panTop.Size
= New System.Drawing.Size(652, 25)
Me.panTop.TabIndex
= 1
'
'lblName
'
Me.lblName.Dock
= System.Windows.Forms.DockStyle.Fill
Me.lblName.Font
= New System.Drawing.Font("Microsoft Sans Serif", 9.75!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblName.ForeColor
= System.Drawing.Color.Gray
Me.lblName.Location = New
System.Drawing.Point(247, 0)
Me.lblName.Name
= "lblName"
Me.lblName.Size
= New System.Drawing.Size(345, 25)
Me.lblName.TabIndex
= 5
Me.lblName.Text
= " "
Me.lblName.TextAlign
= System.Drawing.ContentAlignment.MiddleLeft
'
'panMenu
'
Me.panMenu.Controls.Add(Me.MenuStrip1)
Me.panMenu.Dock
= System.Windows.Forms.DockStyle.Left
Me.panMenu.Location
= New System.Drawing.Point(47, 0)
Me.panMenu.Name
= "panMenu"
Me.panMenu.Size
= New System.Drawing.Size(200, 25)
Me.panMenu.TabIndex
= 4
'
'MenuStrip1
'
Me.MenuStrip1.BackColor
= System.Drawing.Color.White
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.EditToolStripMenuItem,
Me.FornateToolStripMenuItem, Me.HelpToolStripMenuItem, Me.CloseHelpToolStripMenuItem1})
Me.MenuStrip1.Location
= New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name
= "MenuStrip1"
Me.MenuStrip1.Size
= New System.Drawing.Size(200, 24)
Me.MenuStrip1.TabIndex
= 1
Me.MenuStrip1.Text
= "MenuStrip1"
'
'FileToolStripMenuItem
'
Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.NewToolStripMenuItem, Me.OpenToolStripMenuItem,
Me.toolStripSeparator, Me.SaveToolStripMenuItem,
Me.SaveAsToolStripMenuItem, Me.toolStripSeparator1, Me.PrintToolStripMenuItem,
Me.toolStripSeparator2, Me.ExitToolStripMenuItem})
Me.FileToolStripMenuItem.Name
= "FileToolStripMenuItem"
Me.FileToolStripMenuItem.Size
= New System.Drawing.Size(37, 20)
Me.FileToolStripMenuItem.Text
= "&File"
'
'NewToolStripMenuItem
'
Me.NewToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.NewToolStripMenuItem.Name
= "NewToolStripMenuItem"
Me.NewToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.N),
System.Windows.Forms.Keys)
Me.NewToolStripMenuItem.Size
= New System.Drawing.Size(152, 22)
Me.NewToolStripMenuItem.Text
= "&New"
'
'OpenToolStripMenuItem
'
Me.OpenToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.OpenToolStripMenuItem.Name
= "OpenToolStripMenuItem"
Me.OpenToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.O),
System.Windows.Forms.Keys)
Me.OpenToolStripMenuItem.Size
= New System.Drawing.Size(152, 22)
Me.OpenToolStripMenuItem.Text
= "&Open"
'
'toolStripSeparator
'
Me.toolStripSeparator.Name
= "toolStripSeparator"
Me.toolStripSeparator.Size
= New System.Drawing.Size(149, 6)
'
'SaveToolStripMenuItem
'
Me.SaveToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.SaveToolStripMenuItem.Name
= "SaveToolStripMenuItem"
Me.SaveToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.S),
System.Windows.Forms.Keys)
Me.SaveToolStripMenuItem.Size
= New System.Drawing.Size(152, 22)
Me.SaveToolStripMenuItem.Text
= "&Save"
'
'SaveAsToolStripMenuItem
'
Me.SaveAsToolStripMenuItem.Name
= "SaveAsToolStripMenuItem"
Me.SaveAsToolStripMenuItem.Size
= New System.Drawing.Size(152, 22)
Me.SaveAsToolStripMenuItem.Text
= "Save &As"
'
'toolStripSeparator1
'
Me.toolStripSeparator1.Name
= "toolStripSeparator1"
Me.toolStripSeparator1.Size
= New System.Drawing.Size(149, 6)
'
'PrintToolStripMenuItem
'
Me.PrintToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.PrintToolStripMenuItem.Name
= "PrintToolStripMenuItem"
Me.PrintToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.P),
System.Windows.Forms.Keys)
Me.PrintToolStripMenuItem.Size
= New System.Drawing.Size(152, 22)
Me.PrintToolStripMenuItem.Text
= "&Print"
'
'toolStripSeparator2
'
Me.toolStripSeparator2.Name
= "toolStripSeparator2"
Me.toolStripSeparator2.Size
= New System.Drawing.Size(149, 6)
'
'ExitToolStripMenuItem
'
Me.ExitToolStripMenuItem.Name
= "ExitToolStripMenuItem"
Me.ExitToolStripMenuItem.Size
= New System.Drawing.Size(152, 22)
Me.ExitToolStripMenuItem.Text
= "E&xit"
'
'EditToolStripMenuItem
'
Me.EditToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.UndoToolStripMenuItem, Me.RedoToolStripMenuItem,
Me.toolStripSeparator3, Me.CutToolStripMenuItem, Me.CopyToolStripMenuItem,
Me.PasteToolStripMenuItem, Me.toolStripSeparator4, Me.SelectAllToolStripMenuItem,
Me.ToolStripSeparator6, Me.ReadAllTextToolStripMenuItem, Me.ReadSelectedTextToolStripMenuItem,
Me.StopReadingToolStripMenuItem})
Me.EditToolStripMenuItem.Name
= "EditToolStripMenuItem"
Me.EditToolStripMenuItem.Size
= New System.Drawing.Size(39, 20)
Me.EditToolStripMenuItem.Text
= "&Edit"
'
'UndoToolStripMenuItem
'
Me.UndoToolStripMenuItem.Name
= "UndoToolStripMenuItem"
Me.UndoToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Z),
System.Windows.Forms.Keys)
Me.UndoToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.UndoToolStripMenuItem.Text
= "&Undo"
'
'RedoToolStripMenuItem
'
Me.RedoToolStripMenuItem.Name
= "RedoToolStripMenuItem"
Me.RedoToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.Y),
System.Windows.Forms.Keys)
Me.RedoToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.RedoToolStripMenuItem.Text
= "&Redo"
'
'toolStripSeparator3
'
Me.toolStripSeparator3.Name
= "toolStripSeparator3"
Me.toolStripSeparator3.Size
= New System.Drawing.Size(169, 6)
'
'CutToolStripMenuItem
'
Me.CutToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.CutToolStripMenuItem.Name
= "CutToolStripMenuItem"
Me.CutToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.X),
System.Windows.Forms.Keys)
Me.CutToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.CutToolStripMenuItem.Text
= "Cu&t"
'
'CopyToolStripMenuItem
'
Me.CopyToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.CopyToolStripMenuItem.Name
= "CopyToolStripMenuItem"
Me.CopyToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.C),
System.Windows.Forms.Keys)
Me.CopyToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.CopyToolStripMenuItem.Text
= "&Copy"
'
'PasteToolStripMenuItem
'
Me.PasteToolStripMenuItem.ImageTransparentColor
= System.Drawing.Color.Magenta
Me.PasteToolStripMenuItem.Name
= "PasteToolStripMenuItem"
Me.PasteToolStripMenuItem.ShortcutKeys
= CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.V),
System.Windows.Forms.Keys)
Me.PasteToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.PasteToolStripMenuItem.Text
= "&Paste"
'
'toolStripSeparator4
'
Me.toolStripSeparator4.Name
= "toolStripSeparator4"
Me.toolStripSeparator4.Size
= New System.Drawing.Size(169, 6)
'
'SelectAllToolStripMenuItem
'
Me.SelectAllToolStripMenuItem.Name
= "SelectAllToolStripMenuItem"
Me.SelectAllToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.SelectAllToolStripMenuItem.Text
= "Select &All"
'
'ToolStripSeparator6
'
Me.ToolStripSeparator6.Name
= "ToolStripSeparator6"
Me.ToolStripSeparator6.Size
= New System.Drawing.Size(169, 6)
'
'ReadAllTextToolStripMenuItem
'
Me.ReadAllTextToolStripMenuItem.Name
= "ReadAllTextToolStripMenuItem"
Me.ReadAllTextToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.ReadAllTextToolStripMenuItem.Text
= "Read All Text"
'
'ReadSelectedTextToolStripMenuItem
'
Me.ReadSelectedTextToolStripMenuItem.Name
= "ReadSelectedTextToolStripMenuItem"
Me.ReadSelectedTextToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.ReadSelectedTextToolStripMenuItem.Text
= "Read Selected Text"
'
'StopReadingToolStripMenuItem
'
Me.StopReadingToolStripMenuItem.Name
= "StopReadingToolStripMenuItem"
Me.StopReadingToolStripMenuItem.Size
= New System.Drawing.Size(172, 22)
Me.StopReadingToolStripMenuItem.Text
= "Stop Reading"
'
'FornateToolStripMenuItem
'
Me.FornateToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FontToolStripMenuItem, Me.ToolStripSeparator7,
Me.FindToolStripMenuItem, Me.FindAndReplaceToolStripMenuItem, Me.ToolStripSeparator8})
Me.FornateToolStripMenuItem.Name
= "FornateToolStripMenuItem"
Me.FornateToolStripMenuItem.Size
= New System.Drawing.Size(63, 20)
Me.FornateToolStripMenuItem.Text
= "&Formate"
'
'FontToolStripMenuItem
'
Me.FontToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FontColourToolStripMenuItem, Me.SelectedFontColourToolStripMenuItem})
Me.FontToolStripMenuItem.Name
= "FontToolStripMenuItem"
Me.FontToolStripMenuItem.Size
= New System.Drawing.Size(164, 22)
Me.FontToolStripMenuItem.Text = "Font"
'
'FontColourToolStripMenuItem
'
Me.FontColourToolStripMenuItem.Name
= "FontColourToolStripMenuItem"
Me.FontColourToolStripMenuItem.Size
= New System.Drawing.Size(145, 22)
Me.FontColourToolStripMenuItem.Text
= "Font Font"
'
'SelectedFontColourToolStripMenuItem
'
Me.SelectedFontColourToolStripMenuItem.Name
= "SelectedFontColourToolStripMenuItem"
Me.SelectedFontColourToolStripMenuItem.Size
= New System.Drawing.Size(145, 22)
Me.SelectedFontColourToolStripMenuItem.Text
= "Selected Font"
'
'ToolStripSeparator7
'
Me.ToolStripSeparator7.Name
= "ToolStripSeparator7"
Me.ToolStripSeparator7.Size
= New System.Drawing.Size(161, 6)
'
'FindToolStripMenuItem
'
Me.FindToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FindToolStripTextBox3})
Me.FindToolStripMenuItem.Name
= "FindToolStripMenuItem"
Me.FindToolStripMenuItem.Size
= New System.Drawing.Size(164, 22)
Me.FindToolStripMenuItem.Text
= "&Find"
'
'FindToolStripTextBox3
'
Me.FindToolStripTextBox3.Name
= "FindToolStripTextBox3"
Me.FindToolStripTextBox3.Size
= New System.Drawing.Size(200, 23)
Me.FindToolStripTextBox3.ToolTipText
= "Enter Text To Find"
'
'FindAndReplaceToolStripMenuItem
'
Me.FindAndReplaceToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripTextBox1, Me.ToolStripTextBox2})
Me.FindAndReplaceToolStripMenuItem.Name
= "FindAndReplaceToolStripMenuItem"
Me.FindAndReplaceToolStripMenuItem.Size
= New System.Drawing.Size(164, 22)
Me.FindAndReplaceToolStripMenuItem.Text
= "Find and Replace"
'
'ToolStripTextBox1
'
Me.ToolStripTextBox1.Name
= "ToolStripTextBox1"
Me.ToolStripTextBox1.Size
= New System.Drawing.Size(200, 23)
Me.ToolStripTextBox1.ToolTipText
= "Enter Text To Be Replace"
'
'ToolStripTextBox2
'
Me.ToolStripTextBox2.Name
= "ToolStripTextBox2"
Me.ToolStripTextBox2.Size
= New System.Drawing.Size(200, 23)
Me.ToolStripTextBox2.ToolTipText
= "Enter Replacing Text"
'
'ToolStripSeparator8
'
Me.ToolStripSeparator8.Name
= "ToolStripSeparator8"
Me.ToolStripSeparator8.Size
= New System.Drawing.Size(161, 6)
'
'HelpToolStripMenuItem
'
Me.HelpToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Help2ToolStripMenuItem, Me.ToolStripSeparator5,
Me.AboutToolStripMenuItem})
Me.HelpToolStripMenuItem.Name
= "HelpToolStripMenuItem"
Me.HelpToolStripMenuItem.Size
= New System.Drawing.Size(44, 20)
Me.HelpToolStripMenuItem.Text
= "&Help"
'
'Help2ToolStripMenuItem
'
Me.Help2ToolStripMenuItem.Name
= "Help2ToolStripMenuItem"
Me.Help2ToolStripMenuItem.Size
= New System.Drawing.Size(116, 22)
Me.Help2ToolStripMenuItem.Text
= "&Help"
'
'ToolStripSeparator5
'
Me.ToolStripSeparator5.Name
= "ToolStripSeparator5"
Me.ToolStripSeparator5.Size
= New System.Drawing.Size(113, 6)
'
'AboutToolStripMenuItem
'
Me.AboutToolStripMenuItem.Name
= "AboutToolStripMenuItem"
Me.AboutToolStripMenuItem.Size
= New System.Drawing.Size(116, 22)
Me.AboutToolStripMenuItem.Text
= "&About..."
'
'CloseHelpToolStripMenuItem1
'
Me.CloseHelpToolStripMenuItem1.Name
= "CloseHelpToolStripMenuItem1"
Me.CloseHelpToolStripMenuItem1.Size
= New System.Drawing.Size(76, 20)
Me.CloseHelpToolStripMenuItem1.Text
= "Close Help"
'
'panMini
'
Me.panMini.Dock
= System.Windows.Forms.DockStyle.Right
Me.panMini.Location
= New System.Drawing.Point(592, 0)
Me.panMini.Name
= "panMini"
Me.panMini.Size
= New System.Drawing.Size(20, 25)
Me.panMini.TabIndex
= 3
'
'panMaxi
'
Me.panMaxi.Dock
= System.Windows.Forms.DockStyle.Right
Me.panMaxi.Location
= New System.Drawing.Point(612, 0)
Me.panMaxi.Name
= "panMaxi"
Me.panMaxi.Size
= New System.Drawing.Size(20, 25)
Me.panMaxi.TabIndex
= 2
'
'panClose
'
Me.panClose.Dock =
System.Windows.Forms.DockStyle.Right
Me.panClose.Location
= New System.Drawing.Point(632, 0)
Me.panClose.Name
= "panClose"
Me.panClose.Size
= New System.Drawing.Size(20, 25)
Me.panClose.TabIndex
= 1
'
'panxOS
'
Me.panxOS.Dock
= System.Windows.Forms.DockStyle.Left
Me.panxOS.Location
= New System.Drawing.Point(0, 0)
Me.panxOS.Name
= "panxOS"
Me.panxOS.Size
= New System.Drawing.Size(47, 25)
Me.panxOS.TabIndex
= 0
'
'panBother_R
'
Me.panBother_R.BackColor
= System.Drawing.Color.Black
Me.panBother_R.Dock
= System.Windows.Forms.DockStyle.Right
Me.panBother_R.Location
= New System.Drawing.Point(652, 30)
Me.panBother_R.Name
= "panBother_R"
Me.panBother_R.Size
= New System.Drawing.Size(3, 435)
Me.panBother_R.TabIndex
= 2
'
'panBother_L
'
Me.panBother_L.BackColor
= System.Drawing.Color.Black
Me.panBother_L.Dock =
System.Windows.Forms.DockStyle.Left
Me.panBother_L.Location
= New System.Drawing.Point(0, 3)
Me.panBother_L.Name
= "panBother_L"
Me.panBother_L.Size
= New System.Drawing.Size(3, 490)
Me.panBother_L.TabIndex
= 3
'
'panBother_B
'
Me.panBother_B.BackColor
= System.Drawing.Color.Black
Me.panBother_B.Dock
= System.Windows.Forms.DockStyle.Bottom
Me.panBother_B.Location
= New System.Drawing.Point(3, 490)
Me.panBother_B.Name
= "panBother_B"
Me.panBother_B.Size
= New System.Drawing.Size(652, 3)
Me.panBother_B.TabIndex
= 4
'
'rtbxNote
'
Me.rtbxNote.BackColor
= System.Drawing.Color.White
Me.rtbxNote.BorderStyle
= System.Windows.Forms.BorderStyle.None
Me.rtbxNote.Dock
= System.Windows.Forms.DockStyle.Fill
Me.rtbxNote.ForeColor
= System.Drawing.Color.Black
Me.rtbxNote.Location
= New System.Drawing.Point(3, 8)
Me.rtbxNote.Name
= "rtbxNote"
Me.rtbxNote.Size
= New System.Drawing.Size(641, 435)
Me.rtbxNote.TabIndex
= 5
Me.rtbxNote.Text
= ""
'
'panBottom
'
Me.panBottom.BackColor
= System.Drawing.Color.Black
Me.panBottom.Controls.Add(Me.lblTxtCount)
Me.panBottom.Dock
= System.Windows.Forms.DockStyle.Bottom
Me.panBottom.Location
= New System.Drawing.Point(3, 465)
Me.panBottom.Name
= "panBottom"
Me.panBottom.Size
= New System.Drawing.Size(652, 25)
Me.panBottom.TabIndex
= 6
'
'lblTxtCount
'
Me.lblTxtCount.Dock
= System.Windows.Forms.DockStyle.Fill
Me.lblTxtCount.ForeColor
= System.Drawing.Color.White
Me.lblTxtCount.Location
= New System.Drawing.Point(0, 0)
Me.lblTxtCount.Name
= "lblTxtCount"
Me.lblTxtCount.Size
= New System.Drawing.Size(652, 25)
Me.lblTxtCount.TabIndex
= 0
Me.lblTxtCount.Text
= " "
Me.lblTxtCount.TextAlign
= System.Drawing.ContentAlignment.MiddleCenter
'
'panTopSep
'
Me.panTopSep.BackColor
= System.Drawing.Color.Black
Me.panTopSep.Dock
= System.Windows.Forms.DockStyle.Top
Me.panTopSep.Location
= New System.Drawing.Point(3, 28)
Me.panTopSep.Name
= "panTopSep"
Me.panTopSep.Size
= New System.Drawing.Size(652, 2)
Me.panTopSep.TabIndex
= 7
'
'PrtDoc
'
'
'TbCtrlMain
'
Me.TbCtrlMain.Controls.Add(Me.tbpgNote)
Me.TbCtrlMain.Controls.Add(Me.TabPage2)
Me.TbCtrlMain.Dock
= System.Windows.Forms.DockStyle.Fill
Me.TbCtrlMain.Location
= New System.Drawing.Point(0, 0)
Me.TbCtrlMain.Name
= "TbCtrlMain"
Me.TbCtrlMain.SelectedIndex
= 0
Me.TbCtrlMain.Size
= New System.Drawing.Size(655, 493)
Me.TbCtrlMain.TabIndex
= 8
'
'tbpgNote
'
Me.tbpgNote.Controls.Add(Me.rtbxNote)
Me.tbpgNote.Controls.Add(Me.panShaper2)
Me.tbpgNote.Controls.Add(Me.panShaper1)
Me.tbpgNote.Location
= New System.Drawing.Point(4, 22)
Me.tbpgNote.Name
= "tbpgNote"
Me.tbpgNote.Padding
= New System.Windows.Forms.Padding(3)
Me.tbpgNote.Size
= New System.Drawing.Size(647, 467)
Me.tbpgNote.TabIndex
= 0
Me.tbpgNote.Text
= "TabPage1"
Me.tbpgNote.UseVisualStyleBackColor
= True
'
'panShaper2
'
Me.panShaper2.Dock
= System.Windows.Forms.DockStyle.Bottom
Me.panShaper2.Location
= New System.Drawing.Point(3, 443)
Me.panShaper2.Name
= "panShaper2"
Me.panShaper2.Size
= New System.Drawing.Size(641, 21)
Me.panShaper2.TabIndex
= 7
'
'panShaper1
'
Me.panShaper1.Dock
= System.Windows.Forms.DockStyle.Top
Me.panShaper1.Location
= New System.Drawing.Point(3, 3)
Me.panShaper1.Name
= "panShaper1"
Me.panShaper1.Size
= New System.Drawing.Size(641, 5)
Me.panShaper1.TabIndex
= 6
'
'TabPage2
'
Me.TabPage2.Controls.Add(Me.panInfo)
Me.TabPage2.Location
= New System.Drawing.Point(4, 22)
Me.TabPage2.Name
= "TabPage2"
Me.TabPage2.Padding
= New System.Windows.Forms.Padding(3)
Me.TabPage2.Size
= New System.Drawing.Size(647, 467)
Me.TabPage2.TabIndex
= 1
Me.TabPage2.Text
= "TabPage2"
Me.TabPage2.UseVisualStyleBackColor = True
'
'panInfo
'
Me.panInfo.BorderStyle
= System.Windows.Forms.BorderStyle.FixedSingle
Me.panInfo.Controls.Add(Me.btnSave)
Me.panInfo.Controls.Add(Me.lblInfo)
Me.panInfo.Controls.Add(Me.btnInfo)
Me.panInfo.Location
= New System.Drawing.Point(113, 74)
Me.panInfo.Name
= "panInfo"
Me.panInfo.Size
= New System.Drawing.Size(383, 215)
Me.panInfo.TabIndex
= 0
'
'btnSave
'
Me.btnSave.Location
= New System.Drawing.Point(122, 144)
Me.btnSave.Name
= "btnSave"
Me.btnSave.Size
= New System.Drawing.Size(136, 23)
Me.btnSave.TabIndex
= 2
Me.btnSave.Text
= "Save"
Me.btnSave.UseVisualStyleBackColor
= True
'
'lblInfo
'
Me.lblInfo.Dock
= System.Windows.Forms.DockStyle.Top
Me.lblInfo.Font
= New System.Drawing.Font("Microsoft Sans Serif", 11.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblInfo.Location
= New System.Drawing.Point(0, 0)
Me.lblInfo.Name
= "lblInfo"
Me.lblInfo.Size
= New System.Drawing.Size(381, 141)
Me.lblInfo.TabIndex = 1
Me.lblInfo.TextAlign
= System.Drawing.ContentAlignment.MiddleCenter
'
'btnInfo
'
Me.btnInfo.Location
= New System.Drawing.Point(122, 173)
Me.btnInfo.Name
= "btnInfo"
Me.btnInfo.Size
= New System.Drawing.Size(136, 23)
Me.btnInfo.TabIndex
= 0
Me.btnInfo.Text
= "Ok"
Me.btnInfo.UseVisualStyleBackColor
= True
'
'PrtPrvDia
'
Me.PrtPrvDia.AutoScrollMargin
= New System.Drawing.Size(0, 0)
Me.PrtPrvDia.AutoScrollMinSize
= New System.Drawing.Size(0, 0)
Me.PrtPrvDia.ClientSize
= New System.Drawing.Size(400, 300)
Me.PrtPrvDia.Enabled
= True
Me.PrtPrvDia.Icon
= CType(resources.GetObject("PrtPrvDia.Icon"), System.Drawing.Icon)
Me.PrtPrvDia.Name
= "PrtPrvDia"
Me.PrtPrvDia.Visible
= False
'
'frmNoteBUg
'
Me.AutoScaleDimensions
= New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode
= System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize
= New System.Drawing.Size(655, 493)
Me.Controls.Add(Me.panBother_R)
Me.Controls.Add(Me.panTopSep)
Me.Controls.Add(Me.panTop)
Me.Controls.Add(Me.panBottom)
Me.Controls.Add(Me.panBother_B)
Me.Controls.Add(Me.panBother_L)
Me.Controls.Add(Me.panBother_T)
Me.Controls.Add(Me.TbCtrlMain)
Me.Icon
= CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name
= "frmNoteBUg"
Me.Text
= "Form1"
Me.panTop.ResumeLayout(False)
Me.panMenu.ResumeLayout(False)
Me.panMenu.PerformLayout()
Me.MenuStrip1.ResumeLayout(False)
Me.MenuStrip1.PerformLayout()
Me.panBottom.ResumeLayout(False)
Me.TbCtrlMain.ResumeLayout(False)
Me.tbpgNote.ResumeLayout(False)
Me.TabPage2.ResumeLayout(False)
Me.panInfo.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents panBother_T As
System.Windows.Forms.Panel
Friend WithEvents panTop As
System.Windows.Forms.Panel
Friend WithEvents panBother_R As
System.Windows.Forms.Panel
Friend WithEvents panBother_L As
System.Windows.Forms.Panel
Friend WithEvents panBother_B As
System.Windows.Forms.Panel
Friend WithEvents rtbxNote As
System.Windows.Forms.RichTextBox
Friend WithEvents panBottom As
System.Windows.Forms.Panel
Friend WithEvents panxOS As
System.Windows.Forms.Panel
Friend WithEvents panMini As
System.Windows.Forms.Panel
Friend WithEvents panMaxi As
System.Windows.Forms.Panel
Friend WithEvents panClose As
System.Windows.Forms.Panel
#End Region
#Region "Form Actions"
Private Sub frmNoteBug_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try
NewSize = New
fResizeableControl(Me, Me.panBother_R,
Me.panBother_L, Me.panBother_B,
Me.panBother_T)
NewMove = New
fMouseAction(Me, Me.lblName,
Me.panMini)
Me.FormBorderStyle
= Windows.Forms.FormBorderStyle.None
Me.lblName.Text
= "NoteBug"
Me.Text
= Me.lblName.Text
Me.lblTxtCount.Text
= "Wds: 0.00
" & " | Chs:
0.00"
Catch
ex As Exception
Me.Close()
End Try
Try
Dim
strFil As String
= Nothing
strFil = My.Computer.FileSystem.ReadAllText(My.Application.CommandLineArgs(0)).ToString
If
strFil <> Nothing Then
Me.rtbxNote.Text
= "" & My.Computer.FileSystem.ReadAllText(My.Application.CommandLineArgs(0)).ToString
& ""
End
If
Catch
ex As Exception
End Try
End Sub
Private Sub frmNoteBUg_Resize(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles Me.Resize
Try
Dim
xLoc As Double
Dim
yLoc As Double
xLoc = (Me.Width
/ 2) - (Me.panInfo.Width / 2) - 7
yLoc = 74
Me.panInfo.Location
= New Point(xLoc, yLoc)
Catch
ex As Exception
Exit
Sub
End Try
End Sub
#End Region
#Region "Menu"
Private
stringtoprint As String
' Private
printpagesettings As New PageSettings
Dim savetf As Boolean = True
Dim Vc As New
SpeechLib.SpVoice
Private Sub NPad_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
My.Application.SaveMySettingsOnExit
= True
Me.CloseHelpToolStripMenuItem1.Visible
= False
End Sub
Private
strFileName As String
Private Sub OpenToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
OpenToolStripMenuItem.Click
Try
Dim
Opentxt As New
OpenFileDialog
Opentxt.Filter = "Text Files (*.txt)|*.txt|Rich Text Files
(*.rtf)|*rtf"
If
Opentxt.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim
NPDoc As String
= Opentxt.FileName
Dim
openreader As New
StreamReader(NPDoc)
Me.rtbxNote.Text
= openreader.ReadToEnd
openreader.Close()
openreader = Nothing
strFileName = Nothing
strFileName =
Opentxt.FileName.ToString
Me.lblName.Text
= "NoteBug [" & strName & "]"
Call
rtbxNote_TextChanged(sender, e)
End
If
Catch
ex As Exception
MessageBox.Show("There was an error in openning the selected
file.", "NoteBug",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private
isFileSaved As Boolean
= False
Private Sub SaveToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
SaveToolStripMenuItem.Click
Try
Dim
SaveTxt As New
SaveFileDialog
SaveTxt.Filter = "Text Files (*.txt)|*.txt|Rich Text Files
(*.rtf)|*rtf"
If Me.rtbxNote.Text.Length <> Nothing Then
If
SaveTxt.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim
NPDoc As String
= SaveTxt.FileName
Dim
Savewriter As New
StreamWriter(NPDoc)
Savewriter.Write(Me.rtbxNote.Text)
Savewriter.Close()
Savewriter = Nothing
strFileName = Nothing
strFileName =
SaveTxt.FileName.ToString
Me.lblName.Text
= "NoteBug [" & strName & "]"
isFileSaved = True
Call
rtbxNote_TextChanged(sender, e)
End
If
Else
Hider()
Me.btnInfo.Text
= "Ok"
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(1)
Me.lblInfo.Text
= "The file is empty"
End
If
Catch
ex As Exception
ErrorInfo("There
was an error in saving the selected file.")
End Try
End Sub
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
SaveAsToolStripMenuItem.Click
SaveToolStripMenuItem_Click(sender, e)
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
ExitToolStripMenuItem.Click
End
End Sub
Private Sub UndoToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
UndoToolStripMenuItem.Click
Me.rtbxNote.Undo()
End Sub
Private Sub RedoToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
RedoToolStripMenuItem.Click
Me.rtbxNote.Redo()
End Sub
Private Sub CutToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
CutToolStripMenuItem.Click
Me.rtbxNote.Cut()
End Sub
Private Sub CopyToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
CopyToolStripMenuItem.Click
Me.rtbxNote.Copy()
End Sub
Private Sub PasteToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
PasteToolStripMenuItem.Click
Me.rtbxNote.Paste()
End Sub
Private Sub SelectAllToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
SelectAllToolStripMenuItem.Click
Me.rtbxNote.SelectAll()
End Sub
Private Sub FontToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
FontColourToolStripMenuItem.Click
If Me.rtbxNote.Text.Count > 0 Then
If
(FontTxt.ShowDialog() = Windows.Forms.DialogResult.OK) Then
Me.rtbxNote.Font
= FontTxt.Font
End
If
End If
End Sub
Private
FontTxt As New
FontDialog
Private Sub SelectedFontToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
SelectedFontColourToolStripMenuItem.Click
If Me.rtbxNote.SelectedText.Count > 0 Then
If
(FontTxt.ShowDialog() = Windows.Forms.DialogResult.OK) Then
Me.rtbxNote.SelectionFont
= FontTxt.Font
End
If
End If
End Sub
Private Sub btnSave_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(0)
Me.panMenu.Visible
= True
If Me.TbCtrlMain.SelectedTab Is
Me.TbCtrlMain.TabPages(0) Then
Call
SaveToolStripMenuItem_Click(sender, e)
End If
End Sub
Private Sub FindToolStripTextBox3_keypress(ByVal sender As
System.Object, ByVal e As
Windows.Forms.KeyPressEventArgs) Handles
FindToolStripTextBox3.KeyPress
If
Asc(e.KeyChar) = Keys.Enter Then
Dim
FText As String
= FindToolStripTextBox3.Text
If
FText.Count > 0 Then
Me.rtbxNote.Find(FText)
If
Me.rtbxNote.Text.Contains(FText) Then
MessageBox.Show("'" & FText & "' is contained in the text file", "NoteBug", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Else
MessageBox.Show("'" & FText & "' is not contained in the text file", "NoteBug", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End
If
End If
End If
End Sub
Private Sub ToolStripTextBox1_keypress(ByVal sender As
System.Object, ByVal e As
Windows.Forms.KeyPressEventArgs) Handles
ToolStripTextBox1.KeyPress
ToolStripTextBox2_keypress(sender, e)
End Sub
Private Sub ToolStripTextBox2_keypress(ByVal sender As
System.Object, ByVal e As
Windows.Forms.KeyPressEventArgs) Handles
ToolStripTextBox2.KeyPress
If
Asc(e.KeyChar) = Keys.Enter Then
If Me.ToolStripTextBox1.Text.Count > 0 And Me.ToolStripTextBox2.Text.Count
> 0 Then
Dim
FRtxt As String
= Me.rtbxNote.Text
Dim
StrBld As New
StringBuilder(FRtxt)
Dim
FTxt As New
StringBuilder(Me.ToolStripTextBox1.Text)
Dim
RTxt As New StringBuilder(Me.ToolStripTextBox2.Text)
StrBld.Replace(Me.ToolStripTextBox1.Text, Me.ToolStripTextBox2.Text)
Me.rtbxNote.Text
= StrBld.ToString
MessageBox.Show("'" & Me.ToolStripTextBox1.Text
& "' has been replaced with '"
& Me.ToolStripTextBox2.Text & "'", "NoteBug",
MessageBoxButtons.OK, MessageBoxIcon.Information)
End
If
End If
End Sub
Private Sub btnInfo_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnInfo.Click
Try
If Me.btnInfo.Text = "No"
Then
Me.Close()
ElseIf
Me.btnInfo.Text = "Ok"
Then
Me.panMenu.Visible
= True
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(0)
End
If
Catch
ex As Exception
ErrorInfo("There
was an error in printing the selected file.")
End Try
End Sub
Private Sub SaveMe()
Me.btnSave.Visible
= True
Me.btnInfo.Visible
= True
Me.btnSave.Text
= "Save"
Me.btnInfo.Text
= "No"
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(1)
End Sub
Private Sub Hider()
Me.panMenu.Visible
= False
Me.lblInfo.Text
= Nothing
Me.btnInfo.Visible
= True
Me.btnSave.Visible
= False
Me.lblInfo.Text
= Nothing
Me.btnInfo.Text
= Nothing
End Sub
Private Sub AboutToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
AboutToolStripMenuItem.Click
Try
Hider()
Me.panMenu.Visible
= False
Me.lblInfo.Text
= Nothing
Me.btnInfo.Text
= "Ok"
Me.lblInfo.Text
= "Designed and programmed by K. A.
Victor."
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(1)
Catch
ex As Exception
Exit
Sub
End Try
End Sub
Private Sub ErrorInfo(ByVal
strInfo As String)
Me.panMenu.Visible
= False
Me.lblInfo.Text
= Nothing
Me.btnInfo.Text
= "Ok"
Me.lblInfo.Text
= strInfo
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(1)
End Sub
Private Sub Help2ToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
Help2ToolStripMenuItem.Click
Try
Hider()
Me.panMenu.Visible
= False
Me.lblInfo.Text
= Nothing
Me.btnInfo.Text
= "Ok"
Me.lblInfo.Text
= "Sorry, no help was found lol."
& vbNewLine & "Dial 911."
Me.TbCtrlMain.SelectedTab
= Me.TbCtrlMain.TabPages(1)
Catch
ex As Exception
Exit
Sub
End Try
End Sub
Private Sub ReadAllTextToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
ReadAllTextToolStripMenuItem.Click
Vc.Rate = 0.01
Vc.Speak(Me.rtbxNote.Text(),
SpeechVoiceSpeakFlags.SVSFlagsAsync)
End Sub
Private Sub ReadSelectedTextToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
ReadSelectedTextToolStripMenuItem.Click
Vc.Rate = 0.01
Vc.Speak(Me.rtbxNote.SelectedText(),
SpeechVoiceSpeakFlags.SVSFlagsAsync)
End Sub
Private Sub StopReadingToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
StopReadingToolStripMenuItem.Click
Vc.Rate = 0.01
Vc.Speak("",
SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak)
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As
System.EventArgs) Handles
NewToolStripMenuItem.Click
Try
Dim
NewNB As New
frmNoteBUg
NewNB.Show()
Catch
ex As Exception
ErrorInfo("Oops!
Can't open new note.")
End Try
End Sub
#End Region
#Region "Print"
Private Sub PrintToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
PrintToolStripMenuItem.Click
Try
PrtDoc.Print() 'start the printing
Catch
ErrorInfo("There
was an error in printing the selected file.")
End Try
End Sub
Private Sub PrtDoc_PrintPage(ByVal
sender As System.Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles
PrtDoc.PrintPage
Try
Dim
PrintFont As Font
Dim
sinLineHeight As Single
Dim
sinHPrintLoc As Single
Dim
sinVPrintLoc As String
Dim
strPrint As String
Static
stIntPgCount As Integer
PrintFont = New Font(Me.rtbxNote.Font, Me.rtbxNote.Font.Style)
sinLineHeight = PrintFont.GetHeight
+ 2
sinHPrintLoc = e.MarginBounds.Left
sinVPrintLoc = e.MarginBounds.Top
strPrint = Me.rtbxNote.Text
stIntPgCount = 1 'Initial page count
Do ''Print the page number
e.Graphics.DrawString(strPrint,
PrintFont, Brushes.Black, sinHPrintLoc, sinVPrintLoc)
sinVPrintLoc += sinLineHeight
Loop Until sinVPrintLoc >= e.MarginBounds.Bottom
stIntPgCount += 1
'Check if
there are more pages to be printed
If
stIntPgCount <= 1 Then '<= 4 Then 'print more
e.HasMorePages = True
Else 'exit printing
e.HasMorePages = False
stIntPgCount = 1 'reset the printing
End
If
Catch
ex As Exception
ErrorInfo("There
was an error in printing the selected file.")
End Try
End Sub
#End Region
#Region "Top Buttons"
Private
xOSfont As Font
Private
strName As String
Private Sub panMenu_Paint(ByVal
sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles
panxOS.Paint
Try
Dim
xOSrec As Rectangle
xOSrec = New
Rectangle(3, 1, 40, 20)
e.Graphics.DrawRectangle(Pens.Gray,
xOSrec)
xOSfont = New
Font("Microsoft San Seriff", 12,
FontStyle.Bold)
e.Graphics.DrawString("xOS", xOSfont, Brushes.Gray, 5, 1)
Catch
ex As Exception
Me.Close()
End Try
End Sub
Private
isFormClosing As Boolean
= False
Private Sub panClose_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles panClose.Click
Try
If
isFileSaved = True Or
Me.rtbxNote.Text.Count = 0 Then
Me.Close()
ElseIf
isFileSaved = False Or
Me.rtbxNote.Text.Count >= 1 Then
isFormClosing = True
Hider()
SaveMe()
Me.lblInfo.Text
= "Do you want to save the changes made?"
End
If
Catch
ex As Exception
End Try
End Sub
Private Sub panClose_Paint(ByVal
sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles
panClose.Paint
Try
Dim
xOSel As Rectangle
xOSel = New
Rectangle(1, 1, 17, 17)
e.Graphics.FillEllipse(Brushes.Red,
xOSel)
Catch
ex As Exception
Me.Close()
End Try
End Sub
Private Sub panMaxi_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles panMaxi.Click,
lblName.DoubleClick
Try
If Me.WindowState = FormWindowState.Maximized Then
Me.WindowState
= FormWindowState.Normal
ElseIf
Me.WindowState = FormWindowState.Normal Then
Me.WindowState
= FormWindowState.Maximized
End
If
Catch
ex As Exception
Exit
Sub
End Try
End Sub
Private Sub panMaxi_Paint(ByVal
sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles
panMaxi.Paint
Try
Dim
xOSel As Rectangle
xOSel = New
Rectangle(1, 1, 17, 17)
e.Graphics.FillEllipse(Brushes.Orange, xOSel)
Catch
ex As Exception
Exit
Sub
End Try
End Sub
Private Sub panMini_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles panMini.Click
Try
Me.WindowState =
FormWindowState.Minimized
Catch
ex As Exception
Exit
Sub
End Try
End Sub
Private Sub panMini_Paint(ByVal
sender As System.Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles
panMini.Paint
Try
Dim
xOSel As Rectangle
xOSel = New
Rectangle(1, 1, 17, 17)
e.Graphics.FillEllipse(Brushes.Yellow, xOSel)
Catch
ex As Exception
Exit
Sub
End Try
End Sub
#End Region
#Region "Text Counter "
Private Sub DetermineName()
If Me.lblName.Text = "NoteBug"
And GenerateCharacterCount(cnt1).ToString("N") >= 40 Then
Dim
strArray(30) As String
Dim
intArray As Integer
= 0
For
Each items In Me.rtbxNote.Text
strArray(intArray) = items
If
intArray = 20 Then
Exit
For
End
If
intArray += 1
Next
Dim
tbxNew As New
RichTextBox
For
i As Integer =
0 To intArray Step
1
tbxNew.AppendText(strArray(i))
Next
Me.lblName.Text
= "NoteBug [" & tbxNew.Text
& "...]"
End If
End Sub
Private Sub FileIsSaved()
If
isFileSaved = True Then
Exit
Sub
Else
isFileSaved = False
End If
End Sub
Private
cnt1 As String
Private Sub rtbxNote_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles rtbxNote.TextChanged
Try
'Enforce
counting and others
'ClassEnforcer()
savetf = False
Dim
countme As String
countme = Me.rtbxNote.Text
countme = countme.Trim
Dim
ans As New
System.Text.StringBuilder(countme.Length)
Dim
add As Integer
'search
for each characters in the text file
For
add = 0 To countme.Length - 1
Dim
thiswhite As Boolean
= Char.IsWhiteSpace(countme.Chars(add))
Dim
prevwhite As Boolean
= thiswhite
If
thiswhite = True Then
If
prevwhite = True AndAlso
ans.Length > 0 Then
ans.Append(Space(1))
ans.Append(countme.Chars(add))
End
If
End
If
Next
add
Dim
totwords As Integer
= Split(countme, Space(1)).Length
Dim
twiddle As Integer
= 0
cnt1 = Me.rtbxNote.Text
twiddle = GenerateCharacterCount(Me.rtbxNote.Text)
'Displays
text and word counts
Me.lblTxtCount.Text
= Nothing
If Me.rtbxNote.Text.Count <= 0 Then
Me.lblTxtCount.Text
= "[" & strFileName & "] | " & "Wds:
0.00 " & " | Chs: 0.00"
Me.lblName.Text
= "NoteBug"
Else
Me.lblTxtCount.Text
= "[" & strFileName & "] | " & "Wds:
" & totwords.ToString("N")
& _
" | Chs:
" & GenerateCharacterCount(cnt1).ToString("N")
DetermineName()
End
If
FileIsSaved()
Catch
ex As Exception
ErrorInfo("Whoa!
Can't count your text files." & vbNewLine & "Is that a text file?")
End Try
End Sub
Public Function GenerateCharacterCount(ByVal allText As String) As Integer
Try
Dim
rtn As Integer
= 0
Dim
sTemp As String
= allText
sTemp =
sTemp.Replace(Environment.NewLine, String.Empty)
sTemp = sTemp.Trim()
Dim
splitSentences As String()
= Regex.Split(sTemp, "(?<=['""A-Za-z0-9][\.\!\?])\s+(?=[A-Z])")
Dim
cnt As Integer
For
cnt = 0 To splitSentences.Length - 1
Dim
sSentence As String
= splitSentences(cnt).ToString()
sSentence = sSentence.Trim()
Dim
sentence As Char()
= sSentence.ToCharArray()
Dim
i As Integer
For
i = 0 To sentence.Length - 1
If
Char.IsLetterOrDigit(sentence(i)) Or Char.IsPunctuation(sentence(i))
Then
rtn += 1
End
If
Next
Next
Return
rtn
Catch
ex As Exception
ErrorInfo("Whoa!
Can't count your text files." & vbNewLine & "Is that a text file?")
End Try
End Function
#End Region
End Class
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Imports
System.Windows.Forms.Form
Public Class fResizeableControl
Private WithEvents PanelR As
Control
Private WithEvents PanelL As
Control
Private WithEvents PanelB As
Control
Private WithEvents PanelT As
Control
Private
mMouseDown As Boolean
= False
Private
mEdge As EdgeEnum = EdgeEnum.None
Private
mWidth As Integer
= 4
Private
mOutlineDrawn As Boolean
= False
Private
fMain As Form
Private Enum EdgeEnum
None
Right
Left
Top
Bottom
TopLeft
End Enum
Public Sub New(ByVal Main As Form, _
ByVal
panR As Panel, _
ByVal
panL As Panel, _
ByVal
panB As Panel, _
ByVal
panT As Panel)
PanelR = panR
PanelL = panL
PanelB = panB
PanelT = panT
fMain = Main
End Sub
'Mouse enter
Private Sub panelL_MouseEnter(ByVal
sender As Object,
ByVal e As
System.EventArgs) _
Handles
PanelL.MouseEnter, PanelR.MouseEnter
If
fMain.WindowState = FormWindowState.Normal Then
fMain.Cursor = Cursors.SizeWE
End If
End Sub
Private Sub panelB_MouseEnter(ByVal
sender As Object,
ByVal e As
System.EventArgs) _
Handles
PanelB.MouseEnter, PanelT.MouseEnter
If
fMain.WindowState = FormWindowState.Normal Then
fMain.Cursor = Cursors.SizeNS
End If
End Sub
'Mouse Down
Private Sub PanelR_MouseDown(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) _
Handles
PanelR.MouseDown, PanelL.MouseDown, PanelB.MouseDown, PanelT.MouseDown
If
e.Button = Windows.Forms.MouseButtons.Left Then
If
e.Button = Windows.Forms.MouseButtons.Left Then
mMouseDown = True
End
If
End If
End Sub
'Mouse Leave
Private Sub PanelR_MouseLeave(ByVal
sender As Object,
ByVal e As
System.EventArgs) _
Handles
PanelR.MouseLeave, PanelL.MouseLeave, PanelB.MouseLeave, PanelT.MouseLeave
fMain.Cursor = Cursors.Default
End Sub
'Mouse Up
Private Sub PanelR_MouseUp(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) _
Handles
PanelR.MouseUp, PanelL.MouseUp, PanelB.MouseUp, PanelT.MouseUp
'Dim c As
Control = CType(sender, Control)
'c.Cursor =
Cursors.Default
mMouseDown = False
fMain.Cursor = Cursors.Default
End Sub
'mouse move
Private Sub PanelL_MouseMove(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
PanelL.MouseMove
Try
If
fMain.Cursor = Cursors.SizeWE Then
'monitors
size
If
fMain.Size.Width <= 533 Then
fMain.SetBounds(fMain.Left
+ e.X, fMain.Top, _
534, fMain.Height)
mMouseDown = False
Exit
Sub
End
If
'main
resize
If
mMouseDown = True Then
fMain.SetBounds(fMain.Left + e.X,
fMain.Top, _
fMain.Width - e.X, fMain.Height)
fMain.Refresh()
End
If
End
If
Catch
ex As Exception
End Try
End Sub
Private Sub paneR_MouseMove(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
PanelR.MouseMove
Try
If
fMain.Cursor = Cursors.SizeWE Then
'monitors
size
If
fMain.Size.Width <= 533 Then
fMain.SetBounds(fMain.Left,
fMain.Top, _
534, fMain.Height)
mMouseDown = False
Exit
Sub
End
If
'main
resize
If
mMouseDown = True Then
fMain.SetBounds(fMain.Left,
fMain.Top, _
fMain.Width + e.X, fMain.Height)
fMain.Refresh()
End If
End
If
Catch
ex As Exception
End Try
End Sub
Private Sub panelB_MouseMove(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
PanelB.MouseMove
Try
If
fMain.Cursor = Cursors.SizeNS Then
'monitors
size
If
fMain.Size.Height <= 467 Then
fMain.SetBounds(fMain.Left,
fMain.Top, _
fMain.Width, 468)
mMouseDown = False
Exit
Sub
End
If
'main
resize
If
mMouseDown = True Then
fMain.SetBounds(fMain.Left,
fMain.Top, _
fMain.Width, fMain.Height + e.Y)
fMain.Refresh()
End
If
End
If
Catch
ex As Exception
End Try
End Sub
Private Sub panelT_MouseMove(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
PanelT.MouseMove
Try
If
fMain.Cursor = Cursors.SizeNS Then
'monitors
size
If
fMain.Size.Height <= 467 Then
fMain.SetBounds(fMain.Left,
fMain.Top, _
fMain.Width, 468)
mMouseDown = False
Exit
Sub
End
If
'main
resize
If
mMouseDown = True Then
fMain.SetBounds(fMain.Left,
fMain.Top + e.Y, _
fMain.Width, fMain.Height - e.Y)
fMain.Refresh()
End
If
End
If
Catch
ex As Exception
End Try
End Sub
End Class
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Public Class fMouseAction
'Private
NewfMouseAction As fMouseAction
Private
IsMouseDown As Boolean
Private
xLoc As Double
Private
yLoc As Double
Private WithEvents lblMainName As
Control
Private WithEvents lblMini As
Control
Private
Main As Form
Public Sub New(ByVal IMain As Form,
_
ByVal
lblMName As Control, _
ByVal
lblMin As Control)
lblMainName = lblMName
lblMini = lblMin
Main = IMain
End Sub
Private Sub lblMini_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles lblMini.Click
Main.WindowState =
FormWindowState.Minimized
End Sub
'++++++++++++++++++++++++++++++++++++++
'Mouse Action
'++++++++++++++++++++++++++++++++++++++
Private Sub lblMainName_MouseDown(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
lblMainName.MouseDown
IsMouseDown = True
xLoc = Control.MousePosition.X -
Main.Left
yLoc = Control.MousePosition.Y -
Main.Top
End Sub
Private Sub lblMainName_MouseMove(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
lblMainName.MouseMove
If Main.WindowState = FormWindowState.Normal Then
If
IsMouseDown = True Then
Main.Left =
Control.MousePosition.X - xLoc
Main.Top =
Control.MousePosition.Y - yLoc
'Make
it transparent
Main.Opacity = 0.7
End
If
End If
End Sub
Private Sub lblMainName_MouseUp(ByVal
sender As Object,
ByVal e As
System.Windows.Forms.MouseEventArgs) Handles
lblMainName.MouseUp
IsMouseDown = False
If
IsMouseDown = False Then
Main.Opacity = 1
Main.Refresh()
End If
End Sub
End Class