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

📄 form1.frm

📁 LED显示屏
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6165
   ClientLeft      =   2385
   ClientTop       =   2175
   ClientWidth     =   10800
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   6165
   ScaleWidth      =   10800
   Begin ComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   660
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   10800
      _ExtentX        =   19050
      _ExtentY        =   1164
      ButtonWidth     =   1032
      ButtonHeight    =   1005
      AllowCustomize  =   0   'False
      Appearance      =   1
      ImageList       =   "ImageList1"
      _Version        =   327682
      BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
         NumButtons      =   7
         BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   "ButtonOpen"
            Object.ToolTipText     =   "打开文件"
            Object.Tag             =   ""
            ImageKey        =   "ButtonOpen"
         EndProperty
         BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Style           =   3
            MixedState      =   -1  'True
         EndProperty
         BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   "ButtonSave"
            Object.ToolTipText     =   "保存文件"
            Object.Tag             =   ""
            ImageKey        =   "ButtonSave"
         EndProperty
         BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Style           =   3
            MixedState      =   -1  'True
         EndProperty
         BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   "ButtonDis"
            Object.ToolTipText     =   "更新屏幕"
            Object.Tag             =   ""
            ImageKey        =   "Display"
         EndProperty
         BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   ""
            Object.Tag             =   ""
            Style           =   3
            MixedState      =   -1  'True
         EndProperty
         BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7} 
            Key             =   "ButtonTrans"
            Object.ToolTipText     =   "测试线路"
            Object.Tag             =   ""
            ImageKey        =   "ButtonTrans"
         EndProperty
      EndProperty
   End
   Begin ComctlLib.ProgressBar PBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   3
      Top             =   5415
      Width           =   10800
      _ExtentX        =   19050
      _ExtentY        =   661
      _Version        =   327682
      Appearance      =   1
      OLEDropMode     =   1
   End
   Begin VB.Timer Timer1 
      Left            =   4800
      Top             =   4320
   End
   Begin MSCommLib.MSComm Comm1 
      Left            =   5280
      Top             =   2400
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
      RThreshold      =   1
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   5055
      Left            =   0
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   600
      Width           =   10815
   End
   Begin ComctlLib.StatusBar SBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   1
      Top             =   5790
      Width           =   10800
      _ExtentX        =   19050
      _ExtentY        =   661
      SimpleText      =   ""
      _Version        =   327682
      BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
         NumPanels       =   3
         BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Text            =   "就绪"
            TextSave        =   "就绪"
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            AutoSize        =   1
            Object.Width           =   13335
            TextSave        =   ""
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
         BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            TextSave        =   ""
            Key             =   ""
            Object.Tag             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComDlg.CommonDialog CDialog1 
      Left            =   8640
      Top             =   1560
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin ComctlLib.ImageList ImageList1 
      Left            =   5520
      Top             =   840
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   327682
      BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
         NumListImages   =   4
         BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0000
            Key             =   "ButtonOpen"
         EndProperty
         BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":031A
            Key             =   "Display"
         EndProperty
         BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":0634
            Key             =   "ButtonSave"
         EndProperty
         BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
            Picture         =   "Form1.frx":094E
            Key             =   "ButtonTrans"
         EndProperty
      EndProperty
   End
   Begin VB.Menu StrFile 
      Caption         =   "文件"
      Index           =   0
      Begin VB.Menu StrOpen 
         Caption         =   "打开"
         Index           =   1
      End
      Begin VB.Menu StrSave 
         Caption         =   "保存"
         Index           =   2
      End
      Begin VB.Menu saveother 
         Caption         =   "另存为"
         Index           =   2
      End
      Begin VB.Menu StrExit 
         Caption         =   "退出"
         Index           =   3
      End
   End
   Begin VB.Menu StrSet 
      Caption         =   "设置"
      Index           =   0
      Begin VB.Menu StrSeel 
         Caption         =   "效果"
         Index           =   1
         Begin VB.Menu StrMoveUp 
            Caption         =   "滚屏"
            Index           =   2
         End
         Begin VB.Menu filemo 
            Caption         =   "滚行"
            Index           =   0
         End
         Begin VB.Menu StrPage 
            Caption         =   "翻页"
            Index           =   3
         End
      End
      Begin VB.Menu HzkT 
         Caption         =   "字库"
         Index           =   2
         Begin VB.Menu HzkS 
            Caption         =   "宋体"
            Index           =   1
         End
         Begin VB.Menu HzkF 
            Caption         =   "繁体"
            Index           =   2
         End
         Begin VB.Menu HzkK 
            Caption         =   "楷体"
            Index           =   4
         End
      End
      Begin VB.Menu fileComm 
         Caption         =   "串口"
         Begin VB.Menu fileCom1 
            Caption         =   "COM1"
         End
         Begin VB.Menu fileCom2 
            Caption         =   "COM2"
         End
      End
      Begin VB.Menu StrSee 
         Caption         =   "复位"
         Index           =   4
      End
      Begin VB.Menu StrTrans 
         Caption         =   "更新"
         Index           =   5
      End
   End
   Begin VB.Menu StrHelp 
      Caption         =   "帮助"
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim intJ1 As Integer
Private Sub Comm1_OnComm()
'DoEvents
On Error Resume Next
bytRec = Comm1.Input
For I = LBound(bytRec) To UBound(bytRec)
'strText1 = strText1 + " " + Hex(bytRec(I))
intJ1 = intJ1 + 1
'If (intJ) Mod 16 = 0 Then strText1 = strText1 + Chr(13) + Chr(10)
'Debug.Print bytRec(I);
'Debug.Print ",";
DoEvents
Next I
'Debug.Print intJ1

If (bytRec(LBound(bytRec)) = &H66 And bytRec(UBound(bytRec)) = &H99) Then
MsgBox "线路正常", , "测试"
End If
End Sub
Private Sub fileCom1_Click()
If Comm1.PortOpen Then Comm1.PortOpen = False
Comm1.CommPort = 1
Comm1.PortOpen = True
Comm1.InputMode = comInputModeBinary
Comm1.Settings = "38400,N,8,1"
End Sub
Private Sub fileCom2_Click()
If Comm1.PortOpen Then Comm1.PortOpen = False
Comm1.CommPort = 2
Comm1.PortOpen = True
Comm1.InputMode = comInputModeBinary
Comm1.Settings = "38400,N,8,1"
End Sub
Private Sub filemo_Click(Index As Integer)
intFlag1 = 1
blnFlagm = 1
End Sub
Private Sub Form_Load()
SBar1.Panels(2).Text = App.Path
With CDialog1
.Filter = "文本|*.TXT|全部|*.*"
End With
intFlag1 = 2
Form1.Caption = App.Path
strFlagZ = "d:\hzk16.dat"
intI = 0
Comm1.CommPort = 2
If Comm1.PortOpen Then Comm1.PortOpen = False
Comm1.PortOpen = True
Comm1.InputMode = comInputModeBinary
Comm1.Settings = "38400,N,8,1"
PBar1.Visible = False
tFlag1 = True




'strMid = Form1.Text1
'For i = 1 To (8 - Len(Form1.Text1) + 8 * (Len(Form1.Text1) \ 8))
'strMid = strMid + Chr(32)
'Next i
'For i = 1 To 24
'strMid = strMid + Chr(32)
'Next i
'For i = 1 To 24
'strMid = Chr(32) + strMid
'Next i
'lenjk = Len(strMid)
End Sub
Private Sub StrFlash_Click(Index As Integer)
On Error Resume Next
CDialog1.ShowOpen
End Sub
Private Sub Form_Resize()
On Error Resume Next
Form1.Height = 6960
Form1.Width = 10920
End Sub
Private Sub HzkF_Click(Index As Integer)
strFlagZ = "d:\hzk16f.dat"
End Sub
Private Sub HzkS_Click(Index As Integer)
strFlagZ = "d:\hzk16.dat"
End Sub
Private Sub saveother_Click(Index As Integer)
On Error Resume Next
CDialog1.ShowSave
strFilename = CDialog1.FileName
If strFilename <> "" Then
FileNum = FreeFile
Open strFilename For Output As FileNum
Print #FileNum, Text1
Close FileNum
End If
End Sub
Private Sub StrExit_Click(Index As Integer)
Dim State As String
State = MsgBox("真的要退出吗?", vbOKCancel + 32, "信息")
Select Case State
Case vbOK
'Comm1.PortOpen = False
End
Case vbCancel
Cancel = -1
End Select
End Sub
Private Sub StrMoveUp_Click(Index As Integer)
intFlag1 = 1
blnFlagm = 0
End Sub
Private Sub StrOpen_Click(Index As Integer)
Dim FileNum, strT1 As String, strT2 As String
On Error Resume Next
CDialog1.ShowOpen
strFilename = CDialog1.FileName
If strFilename <> "" Then
Text1 = ""
SBar1.Panels(2).Text = strFilename
FileNum = FreeFile
Open strFilename For Input As FileNum
Do While Not EOF(FileNum)
Line Input #FileNum, strT1
strT2 = strT2 + strT1 + Chr(13) + Chr(10)
Loop
Close FileNum
Text1 = strT2
End If
End Sub
Private Sub StrPage_Click(Index As Integer)
intFlag1 = 2
End Sub
Private Sub StrSave_Click(Index As Integer)
On Error Resume Next
If strFilename = "" Then
CDialog1.ShowSave
strFilename = CDialog1.FileName
End If
If strFilename <> "" Then
FileNum = FreeFile

⌨️ 快捷键说明

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