📄 form1.frm
字号:
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 53
Left = 7200
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 24
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 54
Left = 7440
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 23
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 56
Left = 7680
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 22
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 58
Left = 7920
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 21
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 60
Left = 8160
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 20
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 61
Left = 8400
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 19
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 63
Left = 8640
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 18
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 1095
Index = 17
Left = 2160
ScaleHeight = 1065
ScaleWidth = 210
TabIndex = 17
Top = 120
Width = 245
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ForeColor = &H80000008&
Height = 735
Index = 1111
Left = 840
ScaleHeight = 705
ScaleMode = 0 'User
ScaleWidth = 110
TabIndex = 16
Top = 120
Width = 200
End
End
Begin VB.TextBox Text1
ForeColor = &H00C000C0&
Height = 390
Left = 1920
TabIndex = 14
Top = 480
Width = 375
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 7920
Top = 0
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSCommLib.MSComm MSComm1
Left = 8640
Top = 0
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.CommandButton Command7
BackColor = &H8000000D&
Caption = "退出"
Height = 495
Left = 8640
Style = 1 'Graphical
TabIndex = 10
Top = 360
Width = 615
End
Begin VB.CommandButton Command6
BackColor = &H8000000D&
Caption = "弹奏"
Height = 495
Left = 8160
Style = 1 'Graphical
TabIndex = 9
Top = 360
Width = 495
End
Begin VB.CommandButton Command5
BackColor = &H8000000D&
Caption = "播放"
Height = 495
Left = 7560
MaskColor = &H00000000&
Style = 1 'Graphical
TabIndex = 8
Top = 360
Width = 615
End
Begin VB.Frame Frame1
BackColor = &H8000000D&
Caption = "串口选择"
ForeColor = &H8000000E&
Height = 615
Left = 2400
TabIndex = 2
Top = 240
Width = 1815
Begin VB.OptionButton Option2
BackColor = &H8000000D&
Caption = "COM2"
ForeColor = &H8000000E&
Height = 255
Left = 960
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.OptionButton Option1
BackColor = &H8000000D&
Caption = "COM1"
ForeColor = &H8000000E&
Height = 255
Left = 120
TabIndex = 3
Top = 240
Width = 975
End
End
Begin VB.HScrollBar HScroll1
Height = 255
Left = 720
Max = 12
Min = 1
TabIndex = 0
Top = 600
Value = 1
Width = 1095
End
Begin VB.Label Label10
Alignment = 1 'Right Justify
BackColor = &H80000009&
Caption = "+"
Height = 255
Left = 1560
TabIndex = 78
Top = 360
Width = 255
End
Begin VB.Label Label2
BackColor = &H80000009&
Caption = "-"
Height = 255
Left = 720
TabIndex = 77
Top = 360
Width = 255
End
Begin VB.Label Label9
Alignment = 2 'Center
BackColor = &H00FF8080&
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 76
Top = 840
Width = 9255
End
Begin VB.Label Label8
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Height = 375
Left = 6480
TabIndex = 13
Top = 480
Width = 1095
End
Begin VB.Label Label7
BackColor = &H80000004&
BorderStyle = 1 'Fixed Single
ForeColor = &H00FF0000&
Height = 375
Left = 5400
TabIndex = 12
Top = 480
Width = 1095
End
Begin VB.Label Label6
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
ForeColor = &H000000FF&
Height = 375
Left = 4320
TabIndex = 11
Top = 480
Width = 1095
End
Begin VB.Label Label5
Alignment = 2 'Center
BackColor = &H8000000D&
Caption = "编码接收"
ForeColor = &H8000000E&
Height = 255
Left = 6600
TabIndex = 7
Top = 120
Width = 975
End
Begin VB.Label Label4
Alignment = 2 'Center
BackColor = &H8000000D&
Caption = "按键编码"
ForeColor = &H8000000E&
Height = 255
Left = 5520
TabIndex = 6
Top = 120
Width = 855
End
Begin VB.Label Label3
Alignment = 2 'Center
BackColor = &H8000000D&
Caption = "音节显示"
ForeColor = &H8000000E&
Height = 255
Left = 4440
TabIndex = 5
Top = 120
Width = 855
End
Begin VB.Label Label1
BackColor = &H8000000D&
Caption = "音调选择"
ForeColor = &H8000000E&
Height = 255
Left = 0
TabIndex = 1
Top = 600
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sta As Integer
Private isOgain As Boolean '是否重复按键
Private Sub Command5_Click()
With CommonDialog1
.InitDir = "d:\"
.Filter = "txt文件|*.txt"
.Action = 1
MSComm1.Output = "atdt" & .DefaultExt & vbCrLf
Label6.Caption = .Flags
End With
End Sub
Private Sub Form_Load()
Sta = 0
Text1.Text = "C"
MSComm1.CommPort = 1
MSComm1.Settings = "9600,n,8,1"
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.RThreshold = 1
End Sub
Private Sub Timer1_Timer()
Dim outdata(0) As Byte
Data = 0
outdata(0) = CByte(Data) '数据
MSComm1.OutBufferCount = 0
MSComm1.Output = outdata() '动态数组
Timer1.Enabled = False
End Sub
Private Sub MSComm1_OnComm()
Dim indata As Variant
Dim bte(0) As Byte '定义接受数组(1个)
Select Case MSComm1.CommEvent
Case comEvReceive
indata = MSComm1.Input
bte(0) = indata(0)
Label8.Caption = Val("&H" & Hex(bte(0)))
MSComm1.InBufferCount = 0
End Select
End Sub
Private Sub picture1_click(Index As Integer)
Label7.Caption = Sta + Index
'Dim num As Integer
Dim outdata(0) As Byte
Data = Val(Label7.Caption)
outdata(0) = CByte(Data) '数据
MSComm1.OutBufferCount = 0
MSComm1.Output = outdata() '动态数组
Timer1.Enabled = True
Timer1.Interval = 250
Select Case Index
Case 1
Label6.Caption = "..1"
Case 2
Label6.Caption = "..#1"
Case 3
Label6.Caption = "..2"
Case 4
Label6.Caption = "..#2"
Case 5
Label6.Caption = "..3"
Case 6
Label6.Caption = "..4"
Case 7
Label6.Caption = "..#4"
Case 8
Label6.Caption = "..5"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -