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

📄 form2.frm

📁 利用MSCOMM串口通信控件进行异步串行通信的文件传输程序设计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "Form2"
   ClientHeight    =   3990
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5505
   LinkTopic       =   "Form2"
   ScaleHeight     =   3990
   ScaleWidth      =   5505
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Cancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   2640
      TabIndex        =   6
      Top             =   3000
      Width           =   975
   End
   Begin VB.CommandButton OK 
      Caption         =   "确定"
      Height          =   375
      Left            =   960
      TabIndex        =   5
      Top             =   3000
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Caption         =   "串口设置"
      Height          =   2295
      Left            =   480
      TabIndex        =   0
      Top             =   480
      Width           =   4815
      Begin VB.TextBox Setting 
         Height          =   270
         Left            =   1560
         TabIndex        =   4
         Top             =   840
         Width           =   1575
      End
      Begin VB.TextBox Port 
         Height          =   270
         Left            =   1560
         TabIndex        =   3
         Top             =   360
         Width           =   1575
      End
      Begin VB.Label Label2 
         Caption         =   "串口设置"
         Height          =   255
         Left            =   480
         TabIndex        =   2
         Top             =   840
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "串口选择"
         Height          =   255
         Left            =   480
         TabIndex        =   1
         Top             =   480
         Width           =   735
      End
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cancel_Click()
  Form2.Hide
  Unload Form2
  
End Sub

Private Sub OK_Click()
 On Error GoTo SettingError
 
 intport = Val(Form2.Port.Text)
' intTime = Val(Form2.Time.Text)
 strset = Form2.Setting.Text
 
 If Not Form1.MSComm1.PortOpen Then
    Form1.MSComm1.CommPort = inPort
    Form1.MSComm1.Settings = strset
    Form1.MSComm1.PortOpen = True
End If

If Not blnAutoSendFlag And Not blnReceiveFlag Then
     Form1.MSComm1.PortOpen = False
End If

Form2.Hide
Unload Form2
Exit Sub
SettingError:
     intport = 2
     'intTime = 1000
     strset = "9600,n,8,1"
     Form2.Show
     Form2.Setting.Text = strset
     Form2.Port.Text = Str(intport)
    ' Form2.Time.Text = Str(intTime)
     
     MsgBox (Error(Err.Number))
     


 
 
End Sub

⌨️ 快捷键说明

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