📄 form1.vb
字号:
Option Strict On
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
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
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents FontMenu As System.Windows.Forms.MenuItem
Friend WithEvents mFontBold As System.Windows.Forms.MenuItem
Friend WithEvents mFontItalic As System.Windows.Forms.MenuItem
Friend WithEvents mFontUnderline As System.Windows.Forms.MenuItem
Friend WithEvents mFontStrike As System.Windows.Forms.MenuItem
Friend WithEvents mFontSmallCaps As System.Windows.Forms.MenuItem
Friend WithEvents mFontAllCaps As System.Windows.Forms.MenuItem
Friend WithEvents MenuSize As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents mFontRegular As System.Windows.Forms.MenuItem
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'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()
Me.MenuItem2 = New System.Windows.Forms.MenuItem()
Me.mFontAllCaps = New System.Windows.Forms.MenuItem()
Me.MainMenu1 = New System.Windows.Forms.MainMenu()
Me.MenuItem1 = New System.Windows.Forms.MenuItem()
Me.FontMenu = New System.Windows.Forms.MenuItem()
Me.mFontRegular = New System.Windows.Forms.MenuItem()
Me.mFontBold = New System.Windows.Forms.MenuItem()
Me.mFontItalic = New System.Windows.Forms.MenuItem()
Me.mFontUnderline = New System.Windows.Forms.MenuItem()
Me.mFontStrike = New System.Windows.Forms.MenuItem()
Me.mFontSmallCaps = New System.Windows.Forms.MenuItem()
Me.MenuItem3 = New System.Windows.Forms.MenuItem()
Me.MenuSize = New System.Windows.Forms.MenuItem()
'
'MenuItem2
'
Me.MenuItem2.Index = 1
Me.MenuItem2.Text = "Edit"
'
'mFontAllCaps
'
Me.mFontAllCaps.Index = 6
Me.mFontAllCaps.Text = "AllCaps"
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2, Me.FontMenu})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.Text = "File"
'
'FontMenu
'
Me.FontMenu.Index = 2
Me.FontMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mFontRegular, Me.mFontBold, Me.mFontItalic, Me.mFontUnderline, Me.mFontStrike, Me.mFontSmallCaps, Me.mFontAllCaps, Me.MenuItem3, Me.MenuSize})
Me.FontMenu.Text = "Font"
'
'mFontRegular
'
Me.mFontRegular.Index = 0
Me.mFontRegular.Text = "Regular"
'
'mFontBold
'
Me.mFontBold.Index = 1
Me.mFontBold.Text = "Bold"
'
'mFontItalic
'
Me.mFontItalic.Index = 2
Me.mFontItalic.Text = "Italic"
'
'mFontUnderline
'
Me.mFontUnderline.Index = 3
Me.mFontUnderline.Text = "Underline"
'
'mFontStrike
'
Me.mFontStrike.Index = 4
Me.mFontStrike.Text = "Strike"
'
'mFontSmallCaps
'
Me.mFontSmallCaps.Index = 5
Me.mFontSmallCaps.Text = "SmallCaps"
'
'MenuItem3
'
Me.MenuItem3.Index = 7
Me.MenuItem3.Text = "-"
'
'MenuSize
'
Me.MenuSize.Index = 8
Me.MenuSize.Text = "Short Menu"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Menu = Me.MainMenu1
Me.Name = "Form1"
Me.Text = "Long Menu Demo"
End Sub
#End Region
Private Sub MenuSize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuSize.Click
If MenuSize.Text = "Short Menu" Then
MenuSize.Text = "Long Menu"
Else
MenuSize.Text = "Short Menu"
End If
mFontUnderline.Visible = Not mFontUnderline.Visible
mFontStrike.Visible = Not mFontStrike.Visible
mFontSmallCaps.Visible = Not mFontSmallCaps.Visible
mFontAllCaps.Visible = Not mFontAllCaps.Visible
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -