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

📄 welcome.frm

📁 主从报警系统
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form welcome 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Welcome to use alchemy!!"
   ClientHeight    =   7530
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   9600
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   12
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Picture         =   "welcome.frx":0000
   ScaleHeight     =   21858.93
   ScaleMode       =   0  'User
   ScaleWidth      =   22615.38
   StartUpPosition =   2  '屏幕中心
   Begin VB.Timer Timer1 
      Interval        =   10
      Left            =   2400
      Top             =   2520
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   1320
      Top             =   360
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin VB.CommandButton exit 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   7440
      Picture         =   "welcome.frx":1E578
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   6360
      Width           =   1815
   End
   Begin VB.CommandButton start 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   855
      Left            =   5160
      Picture         =   "welcome.frx":23120
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   6360
      Width           =   1815
   End
End
Attribute VB_Name = "welcome"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Receive As Boolean   '是否接受到了从机信号
Private Sub exit_Click()
End
End Sub

Private Sub Form_Load()
RunFlag = False
MSComm1.CommPort = 1
MSComm1.Settings = "1200,n,8,1"
MSComm1.InputLen = 0
MSComm1.InputMode = comInputModeText
MSComm1.RThreshold = 1 '串口参数设定
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
End If
MSComm1.PortOpen = True
End Sub

Private Sub MSComm1_OnComm()
If MSComm1.CommEvent = comEvReceive Then
Receive = True
buffer = MSComm1.Input
hexValue = Hex(Asc(buffer)) '类型转换
Call changePic              '根据信号进行图片变换和窗体转换
End If
End Sub

Private Sub start_Click()
MSComm1.Output = Chr$(&H1&)
If Receive = True Then
welcome.Hide
RunFlag = True
Else
temp = MsgBox("还未接受到从机信号", vbOKOnly, "错误")
End If
End Sub


⌨️ 快捷键说明

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