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

📄 form1.frm

📁 数字显示屏的源程序
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Form1 
   BackColor       =   &H00FFC0C0&
   Caption         =   "LED显示屏调试程序"
   ClientHeight    =   5670
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   6090
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   5670
   ScaleWidth      =   6090
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command15 
      Caption         =   "上移换行"
      Height          =   375
      Left            =   2640
      TabIndex        =   21
      Top             =   4320
      Width           =   855
   End
   Begin VB.CommandButton Command14 
      Caption         =   "立刻显示"
      Height          =   375
      Left            =   3840
      TabIndex        =   20
      Top             =   3960
      Width           =   975
   End
   Begin VB.CommandButton Command13 
      Caption         =   "调用语句"
      Height          =   375
      Left            =   4920
      TabIndex        =   19
      Top             =   5280
      Width           =   1095
   End
   Begin VB.CommandButton Command12 
      Caption         =   "选屏发送"
      Height          =   375
      Left            =   4920
      TabIndex        =   18
      Top             =   4800
      Width           =   1095
   End
   Begin VB.CommandButton Command11 
      Caption         =   "循环结束"
      Height          =   375
      Left            =   1320
      TabIndex        =   17
      Top             =   3840
      Width           =   975
   End
   Begin VB.CommandButton Command10 
      Caption         =   "保存设置"
      Height          =   375
      Left            =   4920
      TabIndex        =   16
      Top             =   4320
      Width           =   1095
   End
   Begin VB.CommandButton Command9 
      Caption         =   "地址设定"
      Height          =   375
      Left            =   4920
      TabIndex        =   15
      Top             =   3840
      Width           =   1095
   End
   Begin VB.CommandButton Command8 
      Caption         =   "设置日期"
      Height          =   375
      Left            =   4920
      TabIndex        =   14
      Top             =   3360
      Width           =   1095
   End
   Begin VB.CommandButton Command7 
      Caption         =   "显示模式"
      Height          =   375
      Left            =   3840
      TabIndex        =   13
      Top             =   3360
      Width           =   975
   End
   Begin VB.CommandButton Command6 
      Caption         =   "闪烁结束"
      Height          =   375
      Left            =   2640
      TabIndex        =   12
      Top             =   3840
      Width           =   855
   End
   Begin VB.CommandButton Command5 
      Caption         =   "闪烁开始"
      Height          =   375
      Left            =   2640
      TabIndex        =   11
      Top             =   3360
      Width           =   975
   End
   Begin VB.CommandButton Command4 
      Caption         =   "循环开始"
      Height          =   375
      Left            =   1320
      TabIndex        =   10
      Top             =   3360
      Width           =   975
   End
   Begin VB.OptionButton Option2 
      BackColor       =   &H00FFC0C0&
      Caption         =   "COM2"
      Height          =   375
      Left            =   2400
      TabIndex        =   9
      Top             =   480
      Width           =   1335
   End
   Begin VB.OptionButton Option1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "COM1"
      Height          =   300
      Left            =   2400
      TabIndex        =   8
      Top             =   240
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "更改滚动时间"
      Height          =   975
      Left            =   1680
      TabIndex        =   5
      Top             =   4560
      Width           =   2415
      Begin MSComCtl2.UpDown UpDown1 
         Height          =   375
         Left            =   2040
         TabIndex        =   7
         Top             =   360
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   661
         _Version        =   393216
         Value           =   1000
         Max             =   10000
         Enabled         =   -1  'True
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   120
         TabIndex        =   6
         Top             =   360
         Width           =   1935
      End
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   4200
      Top             =   5160
   End
   Begin VB.CommandButton Command3 
      BackColor       =   &H00FFC0C0&
      Caption         =   "退出"
      Height          =   495
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   4320
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00FFC0C0&
      Caption         =   "清空"
      Height          =   495
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3240
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FFC0C0&
      Caption         =   "发送"
      Height          =   495
      Left            =   120
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3840
      Width           =   975
   End
   Begin VB.TextBox 发送字符 
      Height          =   1815
      Left            =   600
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Top             =   1320
      Width           =   4935
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   360
      Top             =   4800
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0C0&
      Caption         =   "发送字符"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   600
      TabIndex        =   4
      Top             =   960
      Width           =   900
   End
   Begin VB.Menu timer_gundong 
      Caption         =   "滚动时间"
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim dt(1) As Byte
Dim bt1(1) As Byte
Dim bt2(1) As Byte
Dim bt3(3) As Byte
Dim bt4(13) As Byte

Dim bt5(3) As Byte

Dim bt6(3) As Byte
Dim bt7(1) As Byte
Dim bt8(3) As Byte

Dim bt9(3) As Byte
Dim dt10(1) As Byte
Dim dt11(2) As Byte












Private Sub Command1_Click()




MSComm1.Output = 发送字符.Text



End Sub

Private Sub Command10_Click()

On Error GoTo err

bt6(1) = &H1D
bt6(2) = &H0

bt6(3) = &H0


MSComm1.Output = bt6()


err:
 Exit Sub


End Sub

Private Sub Command11_Click()

dt(1) = &H16

MSComm1.Output = dt()





End Sub

Private Sub Command12_Click()

On Error GoTo err

bt8(1) = &H1E
bt8(2) = &H0

bt8(3) = &H0


MSComm1.Output = bt8()


err:
 Exit Sub




End Sub

Private Sub Command13_Click()

On Error GoTo err

bt9(1) = &H1C
bt9(2) = &H0

bt9(3) = &H0


MSComm1.Output = bt9()


err:
 Exit Sub




End Sub

Private Sub Command14_Click()

dt10(1) = &H18

MSComm1.Output = dt10()


End Sub

Private Sub Command15_Click()
dt11(1) = &H12


MSComm1.Output = dt11()



End Sub


Private Sub Command2_Click()

发送字符.Text = "                  "

MSComm1.Output = 发送字符.Text




End Sub

Private Sub Command3_Click()

MSComm1.PortOpen = False

End


End Sub







Private Sub Command4_Click()



dt(1) = &H16

MSComm1.Output = dt()






End Sub

Private Sub Command5_Click()


bt1(1) = &H10

MSComm1.Output = bt1()


End Sub

Private Sub Command6_Click()
bt2(1) = &H11

MSComm1.Output = bt2()

End Sub

Private Sub Command7_Click()

On Error GoTo err

bt3(1) = &H19
bt3(2) = &H0

bt3(3) = &H0


MSComm1.Output = bt3()


err:
 Exit Sub
 
End Sub

Private Sub Command8_Click()
On Error GoTo err

bt4(1) = &H1A
bt4(2) = &H0
bt4(3) = &H0
bt4(4) = &H4
bt4(5) = &H2
bt4(6) = &H1
bt4(7) = &H7
bt4(8) = &H2
bt4(9) = &H2
bt4(10) = &H0
bt4(11) = &H8
bt4(12) = &H0
bt4(13) = &H4


MSComm1.Output = bt4()


err:
 Exit Sub


End Sub

Private Sub Command9_Click()
On Error GoTo err

bt5(1) = &H1F
bt5(2) = &H0

bt5(3) = &H0


MSComm1.Output = bt5()


err:
 Exit Sub




End Sub

Private Sub Form_Load()


MSComm1.PortOpen = True


发送字符.Text = "北京东方安成电子技术开发有限公司  "


MSComm1.Output = 发送字符.Text




Call Command10_Click   '回显地址码



End Sub



Private Sub Option1_Click()

'MSComm1.PortOpen = True


'MSComm1.CommPort = 1

End Sub

Private Sub Option2_Click()


'MSComm1.PortOpen = True

'MSComm1.CommPort = 2


End Sub

Public Sub Text1_Change()



UpDown1.Value = Text1.Text






End Sub

Private Sub timer_gundong_Click()

 
Text1.Text = 1000
 
Frame1.Enabled = True

End Sub

Private Sub Timer1_Timer()

MSComm1.Output = 发送字符.Text

Timer1.Interval = UpDown1.Value

End Sub

Public Sub UpDown1_Change()

Text1.Text = UpDown1.Value

End Sub

⌨️ 快捷键说明

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