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

📄 frmmain.frm

📁 VB与分布式监控光盘源代码第五章命令的发送和读取
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3645
   ClientLeft      =   45
   ClientTop       =   210
   ClientWidth     =   6000
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   9
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   3645
   ScaleWidth      =   6000
   Begin VB.TextBox txtReceive 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1275
      Left            =   405
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   6
      Text            =   "frmMain.frx":0000
      Top             =   1575
      Width           =   2670
   End
   Begin VB.TextBox txtSend 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   510
      Left            =   405
      TabIndex        =   3
      Text            =   "$012"
      Top             =   495
      Width           =   2625
   End
   Begin VB.CommandButton cmdRead 
      Caption         =   "读取数据"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   600
      Left            =   3780
      TabIndex        =   2
      Top             =   1440
      Width           =   1590
   End
   Begin VB.CommandButton cmdSend 
      Caption         =   "发送命令"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   600
      Left            =   3780
      TabIndex        =   1
      Top             =   450
      Width           =   1590
   End
   Begin VB.CommandButton cmdEnd 
      Caption         =   "结束"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   600
      Left            =   3780
      TabIndex        =   0
      Top             =   2430
      Width           =   1590
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   2025
      Top             =   3015
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin VB.Label Label1 
      Caption         =   "返回区"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Index           =   1
      Left            =   405
      TabIndex        =   5
      Top             =   1215
      Width           =   780
   End
   Begin VB.Label Label1 
      Caption         =   "命令区"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Index           =   0
      Left            =   450
      TabIndex        =   4
      Top             =   135
      Width           =   780
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'单击【结束】按钮后触发此事件
'使用End命令将系统结束
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub cmdEnd_Click()
  End
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'单击【读取数据】按钮后触发此事件
'利用Input属性接收模块返回的数据,并显示在返回区文本框中
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub cmdRead_Click()
  txtReceive.Text = MSComm1.Input
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'单击【发送命令】按钮后触发此事件
'将写在命令区文本框中的字符串利用Output属性将其发送

⌨️ 快捷键说明

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