6.13.frm

来自「vb编程+从基础到实践光盘代码」· FRM 代码 · 共 61 行

FRM
61
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3150
   ClientLeft      =   60
   ClientTop       =   390
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3150
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Txt 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   240
      TabIndex        =   0
      Top             =   600
      Width           =   4215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Txt_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim Str1 As String
    If KeyCode = vbKeyF1 Then
        Select Case Shift
            Case 7
                Str1 = "Alt+Ctrl+Shift+"
            Case 5
                Str1 = "Alt+Shift+"
            Case 3
                Str1 = "Ctrl+Shift+"
            Case 6
                Str1 = "Alt+Ctrl+"
            Case 1
                Str1 = "Shift+"
            Case 2
                Str1 = "Ctrl+"
            Case 4
                Str1 = "Alt+"
            Case Else
                Str1 = ""
        End Select
        Txt.Text = "您按了" & Str1 & "F1键"
    Else
        Txt.Text = "您未按F1键"
    End If
End Sub

⌨️ 快捷键说明

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