⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 用keil c和vb开发的单片机通用usb键盘
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMain 
   Caption         =   "709 usb digital small  key"
   ClientHeight    =   4875
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   7935
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   26.25
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   4875
   ScaleWidth      =   7935
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text12 
      Height          =   885
      Left            =   5760
      TabIndex        =   15
      Top             =   2760
      Width           =   1215
   End
   Begin VB.TextBox Text11 
      Height          =   855
      Left            =   4320
      TabIndex        =   14
      Top             =   2760
      Width           =   1215
   End
   Begin VB.TextBox Text10 
      Height          =   855
      Left            =   2880
      TabIndex        =   13
      Top             =   2760
      Width           =   1215
   End
   Begin VB.TextBox Text9 
      Height          =   855
      Left            =   1440
      TabIndex        =   12
      Top             =   2760
      Width           =   1215
   End
   Begin VB.TextBox Text8 
      Height          =   855
      Left            =   5760
      TabIndex        =   11
      Top             =   1800
      Width           =   1215
   End
   Begin VB.TextBox Text7 
      Height          =   855
      Left            =   4320
      TabIndex        =   10
      Top             =   1800
      Width           =   1215
   End
   Begin VB.TextBox Text6 
      Height          =   855
      Left            =   2880
      TabIndex        =   9
      Top             =   1800
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Height          =   855
      Left            =   1440
      TabIndex        =   8
      Top             =   1800
      Width           =   1215
   End
   Begin VB.TextBox Text4 
      Height          =   855
      Left            =   5760
      TabIndex        =   7
      Top             =   840
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Height          =   855
      Left            =   4320
      TabIndex        =   6
      Top             =   840
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   855
      Left            =   2880
      TabIndex        =   5
      Top             =   840
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   855
      Left            =   1440
      TabIndex        =   4
      Top             =   840
      Width           =   1215
   End
   Begin VB.TextBox Text25 
      Height          =   645
      Left            =   1560
      TabIndex        =   3
      Text            =   "Text25"
      Top             =   4080
      Width           =   1335
   End
   Begin VB.Timer Timer1 
      Interval        =   50
      Left            =   600
      Top             =   3960
   End
   Begin VB.CommandButton Command26 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5640
      TabIndex        =   1
      Top             =   4200
      Width           =   1215
   End
   Begin VB.CommandButton Command25 
      Caption         =   "刷新"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3960
      TabIndex        =   0
      Top             =   4200
      Width           =   1215
   End
   Begin VB.Label usb 
      BackStyle       =   0  'Transparent
      Caption         =   "usb 空白热键测试程序"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   615
      Left            =   480
      TabIndex        =   2
      Top             =   120
      Width           =   5295
   End
   Begin VB.Menu mnuFile 
      Caption         =   "文件(&F)"
      Begin VB.Menu mnuFileExit 
         Caption         =   "退出(&X)"
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "帮助(&H)"
      Begin VB.Menu mnuHelpAbout 
         Caption         =   "关于(&A) "
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Command1_Click()

End Sub

Private Sub Command25_Click()
Text1.BackColor = &H80000005
Text2.BackColor = &H80000005
Text3.BackColor = &H80000005
Text4.BackColor = &H80000005
Text5.BackColor = &H80000005
Text6.BackColor = &H80000005
Text7.BackColor = &H80000005
Text8.BackColor = &H80000005
Text9.BackColor = &H80000005
Text10.BackColor = &H80000005
Text11.BackColor = &H80000005
Text12.BackColor = &H80000005

End Sub

Private Sub Command26_Click()
'卸载窗体
    Unload Me
End Sub

Private Sub Command5_Click()
Text17.BackColor = &HFF
End Sub

Private Sub Form_Load()
    Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
    Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
    Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
    Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
End Sub


Private Sub Form_Unload(Cancel As Integer)
    Dim i As Integer


    'close all sub forms
    For i = Forms.Count - 1 To 1 Step -1
        Unload Forms(i)
    Next
    If Me.WindowState <> vbMinimized Then
        SaveSetting App.Title, "Settings", "MainLeft", Me.Left
        SaveSetting App.Title, "Settings", "MainTop", Me.Top
        SaveSetting App.Title, "Settings", "MainWidth", Me.Width
        SaveSetting App.Title, "Settings", "MainHeight", Me.Height
    End If
End Sub

Private Sub mnuHelpAbout_Click()
    MsgBox "版本 " & App.Major & "." & App.Minor & "." & App.Revision
End Sub

Private Sub mnuFileExit_Click()
    '卸载窗体
    Unload Me

End Sub



Private Sub sbStatusBar_PanelClick(ByVal Panel As MSComctlLib.Panel)

End Sub

Private Sub Text17_Change()

End Sub

Private Sub Text1_Change()

End Sub

Private Sub Text25_Change()

End Sub

Private Sub Timer1_Timer()
Dim data As Byte
Dim ccc As Integer
Dim flag As Long
flag = ReadPort1(data, 4)


ccc = CInt(data)
Text25.Text = CStr(ccc)
If ccc = 26 Then
Text1.BackColor = &HFF0000
Else
If ccc = 27 Then
Text2.BackColor = &HFF0000
Else
If ccc = 28 Then
Text3.BackColor = &HFF0000
Else:
If ccc = 29 Then
Text4.BackColor = &HFF0000
Else:
If ccc = 30 Then
Text5.BackColor = &HFF0000
Else:
If ccc = 31 Then
Text6.BackColor = &HFF0000
Else:
If ccc = 32 Then
Text7.BackColor = &HFF0000
Else:
If ccc = 33 Then
Text8.BackColor = &HFF0000
Else:
If ccc = 34 Then
Text9.BackColor = &HFF0000
Else:
If ccc = 35 Then
Text10.BackColor = &HFF0000
Else:
If ccc = 36 Then
Text11.BackColor = &HFF0000
Else:
If ccc = 37 Then
Text12.BackColor = &HFF0000


Else: ccc = 38


End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If


End Sub

⌨️ 快捷键说明

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