📄 form1.vb
字号:
Public Class Form1
Inherits System.Windows.Forms.Form
Dim bool As Boolean = False
Dim pdoc As New System.drawing.printing.PrintDocument
Dim i = 1, k As Integer
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents MenuFile As System.Windows.Forms.MenuItem
Friend WithEvents MenuNew As System.Windows.Forms.MenuItem
Friend WithEvents MenuOpen As System.Windows.Forms.MenuItem
Friend WithEvents MenuSave As System.Windows.Forms.MenuItem
Friend WithEvents MenuSaveAs As System.Windows.Forms.MenuItem
Friend WithEvents MenuPrintSetup As System.Windows.Forms.MenuItem
Friend WithEvents MenuPrint As System.Windows.Forms.MenuItem
Friend WithEvents MenuExit As System.Windows.Forms.MenuItem
Friend WithEvents MenuEdit As System.Windows.Forms.MenuItem
Friend WithEvents MenuCancel As System.Windows.Forms.MenuItem
Friend WithEvents MenuCut As System.Windows.Forms.MenuItem
Friend WithEvents MenuCopy As System.Windows.Forms.MenuItem
Friend WithEvents MenuPaste As System.Windows.Forms.MenuItem
Friend WithEvents MenuDelete As System.Windows.Forms.MenuItem
Friend WithEvents MenuFind As System.Windows.Forms.MenuItem
Friend WithEvents MenuReplace As System.Windows.Forms.MenuItem
Friend WithEvents MenuSelectAll As System.Windows.Forms.MenuItem
Friend WithEvents MenuDate As System.Windows.Forms.MenuItem
Friend WithEvents MenuFormat As System.Windows.Forms.MenuItem
Friend WithEvents MenuAuto As System.Windows.Forms.MenuItem
Friend WithEvents MenuFont As System.Windows.Forms.MenuItem
Friend WithEvents MenuView As System.Windows.Forms.MenuItem
Friend WithEvents MenuStateBar As System.Windows.Forms.MenuItem
Friend WithEvents MenuToolBar As System.Windows.Forms.MenuItem
Friend WithEvents MenuHelp As System.Windows.Forms.MenuItem
Friend WithEvents MenuAbout As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton4 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton5 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton6 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton7 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton8 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton9 As System.Windows.Forms.ToolBarButton
Friend WithEvents ToolBarButton10 As System.Windows.Forms.ToolBarButton
Friend WithEvents RTextBox As System.Windows.Forms.RichTextBox
Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
Friend WithEvents StatusBarPanel1 As System.Windows.Forms.StatusBarPanel
Friend WithEvents StatusBarPanel2 As System.Windows.Forms.StatusBarPanel
Friend WithEvents OFD As System.Windows.Forms.OpenFileDialog
Friend WithEvents SFD As System.Windows.Forms.SaveFileDialog
Friend WithEvents PSD As System.Windows.Forms.PageSetupDialog
Friend WithEvents PD As System.Windows.Forms.PrintDialog
Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
Friend WithEvents FD As System.Windows.Forms.FontDialog
Friend WithEvents Timer1 As System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.MenuFile = New System.Windows.Forms.MenuItem
Me.MenuNew = New System.Windows.Forms.MenuItem
Me.MenuOpen = New System.Windows.Forms.MenuItem
Me.MenuSave = New System.Windows.Forms.MenuItem
Me.MenuSaveAs = New System.Windows.Forms.MenuItem
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuPrintSetup = New System.Windows.Forms.MenuItem
Me.MenuPrint = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuExit = New System.Windows.Forms.MenuItem
Me.MenuEdit = New System.Windows.Forms.MenuItem
Me.MenuCancel = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.MenuCut = New System.Windows.Forms.MenuItem
Me.MenuCopy = New System.Windows.Forms.MenuItem
Me.MenuPaste = New System.Windows.Forms.MenuItem
Me.MenuDelete = New System.Windows.Forms.MenuItem
Me.MenuItem4 = New System.Windows.Forms.MenuItem
Me.MenuFind = New System.Windows.Forms.MenuItem
Me.MenuReplace = New System.Windows.Forms.MenuItem
Me.MenuItem5 = New System.Windows.Forms.MenuItem
Me.MenuSelectAll = New System.Windows.Forms.MenuItem
Me.MenuDate = New System.Windows.Forms.MenuItem
Me.MenuFormat = New System.Windows.Forms.MenuItem
Me.MenuAuto = New System.Windows.Forms.MenuItem
Me.MenuFont = New System.Windows.Forms.MenuItem
Me.MenuView = New System.Windows.Forms.MenuItem
Me.MenuStateBar = New System.Windows.Forms.MenuItem
Me.MenuToolBar = New System.Windows.Forms.MenuItem
Me.MenuItem6 = New System.Windows.Forms.MenuItem
Me.MenuHelp = New System.Windows.Forms.MenuItem
Me.MenuAbout = New System.Windows.Forms.MenuItem
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.ToolBar1 = New System.Windows.Forms.ToolBar
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton4 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton5 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton6 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton7 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton8 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton9 = New System.Windows.Forms.ToolBarButton
Me.ToolBarButton10 = New System.Windows.Forms.ToolBarButton
Me.RTextBox = New System.Windows.Forms.RichTextBox
Me.StatusBar1 = New System.Windows.Forms.StatusBar
Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel
Me.StatusBarPanel2 = New System.Windows.Forms.StatusBarPanel
Me.OFD = New System.Windows.Forms.OpenFileDialog
Me.SFD = New System.Windows.Forms.SaveFileDialog
Me.PSD = New System.Windows.Forms.PageSetupDialog
Me.PD = New System.Windows.Forms.PrintDialog
Me.FD = New System.Windows.Forms.FontDialog
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.StatusBarPanel2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuFile, Me.MenuEdit, Me.MenuFormat, Me.MenuView, Me.MenuHelp})
'
'MenuFile
'
Me.MenuFile.Index = 0
Me.MenuFile.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuNew, Me.MenuOpen, Me.MenuSave, Me.MenuSaveAs, Me.MenuItem1, Me.MenuPrintSetup, Me.MenuPrint, Me.MenuItem2, Me.MenuExit})
Me.MenuFile.ShowShortcut = False
Me.MenuFile.Text = "文件(&F)"
'
'MenuNew
'
Me.MenuNew.Index = 0
Me.MenuNew.Shortcut = System.Windows.Forms.Shortcut.CtrlN
Me.MenuNew.Text = "新建(&N)"
'
'MenuOpen
'
Me.MenuOpen.Index = 1
Me.MenuOpen.Shortcut = System.Windows.Forms.Shortcut.CtrlO
Me.MenuOpen.Text = "打开(&O)"
'
'MenuSave
'
Me.MenuSave.Index = 2
Me.MenuSave.Shortcut = System.Windows.Forms.Shortcut.CtrlS
Me.MenuSave.Text = "保存(&S)"
'
'MenuSaveAs
'
Me.MenuSaveAs.Index = 3
Me.MenuSaveAs.Text = "另保存(&A)"
'
'MenuItem1
'
Me.MenuItem1.Index = 4
Me.MenuItem1.Text = "-"
'
'MenuPrintSetup
'
Me.MenuPrintSetup.Index = 5
Me.MenuPrintSetup.Text = "页面设置(&U)"
'
'MenuPrint
'
Me.MenuPrint.Index = 6
Me.MenuPrint.Shortcut = System.Windows.Forms.Shortcut.CtrlP
Me.MenuPrint.Text = "打印(&P)"
'
'MenuItem2
'
Me.MenuItem2.Index = 7
Me.MenuItem2.Text = "-"
'
'MenuExit
'
Me.MenuExit.Index = 8
Me.MenuExit.Text = "退出(&X)"
'
'MenuEdit
'
Me.MenuEdit.Index = 1
Me.MenuEdit.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuCancel, Me.MenuItem3, Me.MenuCut, Me.MenuCopy, Me.MenuPaste, Me.MenuDelete, Me.MenuItem4, Me.MenuFind, Me.MenuReplace, Me.MenuItem5, Me.MenuSelectAll, Me.MenuDate})
Me.MenuEdit.ShowShortcut = False
Me.MenuEdit.Text = "编辑(&E)"
'
'MenuCancel
'
Me.MenuCancel.Index = 0
Me.MenuCancel.Shortcut = System.Windows.Forms.Shortcut.CtrlZ
Me.MenuCancel.Text = "撤消(&U)"
'
'MenuItem3
'
Me.MenuItem3.Index = 1
Me.MenuItem3.Text = "-"
'
'MenuCut
'
Me.MenuCut.Index = 2
Me.MenuCut.Shortcut = System.Windows.Forms.Shortcut.CtrlX
Me.MenuCut.Text = "剪切(&T)"
'
'MenuCopy
'
Me.MenuCopy.Index = 3
Me.MenuCopy.Shortcut = System.Windows.Forms.Shortcut.CtrlC
Me.MenuCopy.Text = "复制(&C)"
'
'MenuPaste
'
Me.MenuPaste.Index = 4
Me.MenuPaste.Shortcut = System.Windows.Forms.Shortcut.CtrlV
Me.MenuPaste.Text = "粘贴(&P)"
'
'MenuDelete
'
Me.MenuDelete.Index = 5
Me.MenuDelete.Text = "删除(&L)"
'
'MenuItem4
'
Me.MenuItem4.Index = 6
Me.MenuItem4.Text = "-"
'
'MenuFind
'
Me.MenuFind.Index = 7
Me.MenuFind.Shortcut = System.Windows.Forms.Shortcut.CtrlF
Me.MenuFind.Text = "查找(&F)"
'
'MenuReplace
'
Me.MenuReplace.Index = 8
Me.MenuReplace.Shortcut = System.Windows.Forms.Shortcut.CtrlR
Me.MenuReplace.Text = "替换(&R)"
'
'MenuItem5
'
Me.MenuItem5.Index = 9
Me.MenuItem5.Text = "-"
'
'MenuSelectAll
'
Me.MenuSelectAll.Index = 10
Me.MenuSelectAll.Shortcut = System.Windows.Forms.Shortcut.CtrlA
Me.MenuSelectAll.Text = "全选(&A)"
'
'MenuDate
'
Me.MenuDate.Index = 11
Me.MenuDate.Shortcut = System.Windows.Forms.Shortcut.F5
Me.MenuDate.Text = "日期(&D)"
'
'MenuFormat
'
Me.MenuFormat.Index = 2
Me.MenuFormat.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuAuto, Me.MenuFont})
Me.MenuFormat.ShowShortcut = False
Me.MenuFormat.Text = "格式(&O)"
'
'MenuAuto
'
Me.MenuAuto.Index = 0
Me.MenuAuto.RadioCheck = True
Me.MenuAuto.ShowShortcut = False
Me.MenuAuto.Text = "自动换行(&W)"
'
'MenuFont
'
Me.MenuFont.Index = 1
Me.MenuFont.ShowShortcut = False
Me.MenuFont.Text = "字体(&F)"
'
'MenuView
'
Me.MenuView.Index = 3
Me.MenuView.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuStateBar, Me.MenuToolBar})
Me.MenuView.ShowShortcut = False
Me.MenuView.Text = "查看(&V)"
'
'MenuStateBar
'
Me.MenuStateBar.Index = 0
Me.MenuStateBar.RadioCheck = True
Me.MenuStateBar.ShowShortcut = False
Me.MenuStateBar.Text = "状态栏(&S)"
'
'MenuToolBar
'
Me.MenuToolBar.Index = 1
Me.MenuToolBar.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem6})
Me.MenuToolBar.RadioCheck = True
Me.MenuToolBar.ShowShortcut = False
Me.MenuToolBar.Text = "工具栏(&T)"
'
'MenuItem6
'
Me.MenuItem6.Index = 0
Me.MenuItem6.Text = ""
'
'MenuHelp
'
Me.MenuHelp.Index = 4
Me.MenuHelp.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuAbout})
Me.MenuHelp.ShowShortcut = False
Me.MenuHelp.Text = "帮助(&H)"
'
'MenuAbout
'
Me.MenuAbout.Index = 0
Me.MenuAbout.ShowShortcut = False
Me.MenuAbout.Text = "关于记事本(&A)"
'
'ImageList1
'
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
'
'ToolBar1
'
Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2, Me.ToolBarButton3, Me.ToolBarButton4, Me.ToolBarButton5, Me.ToolBarButton6, Me.ToolBarButton7, Me.ToolBarButton8, Me.ToolBarButton9, Me.ToolBarButton10})
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.ImageList = Me.ImageList1
Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(792, 28)
Me.ToolBar1.TabIndex = 0
'
'ToolBarButton1
'
Me.ToolBarButton1.ImageIndex = 0
Me.ToolBarButton1.ToolTipText = "新建"
'
'ToolBarButton2
'
Me.ToolBarButton2.ImageIndex = 1
Me.ToolBarButton2.ToolTipText = "打开"
'
'ToolBarButton3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -