cmdmenu.vb

来自「《ViSUAL BASIC》设计模式」· VB 代码 · 共 22 行

VB
22
字号
Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Color
Imports System.WinForms

Public Class CmdMenu
    Implements CommandHolder
    Inherits MenuItem   
    Protected comd As Command
    '-----
    Public Sub New(ByVal lbl As String, ByVal cmd As Command, ByVal evh As EventHandler)
        MyBase.New(lbl)
        AddHandler Click, evh
        comd = cmd
    End Sub
    '-----
    Public Function getCommand() As Command Implements CommandHolder.getCommand
        Return comd
    End Function
End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?