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

📄 form2.frm

📁 三个串口助手源码.rar
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   BackColor       =   &H00C0C0C0&
   Caption         =   "设置"
   ClientHeight    =   3720
   ClientLeft      =   2865
   ClientTop       =   2460
   ClientWidth     =   6180
   LinkTopic       =   "Form2"
   ScaleHeight     =   3720
   ScaleWidth      =   6180
   Begin VB.ComboBox Combo5 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "Form2.frx":0000
      Left            =   1800
      List            =   "Form2.frx":000A
      TabIndex        =   11
      Text            =   "1"
      Top             =   1680
      Width           =   855
   End
   Begin VB.ComboBox Combo4 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "Form2.frx":0014
      Left            =   4320
      List            =   "Form2.frx":0021
      TabIndex        =   9
      Text            =   "8"
      Top             =   1080
      Width           =   1095
   End
   Begin VB.ComboBox Combo3 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "Form2.frx":002E
      Left            =   1800
      List            =   "Form2.frx":003B
      TabIndex        =   7
      Text            =   "N"
      Top             =   1080
      Width           =   855
   End
   Begin VB.ComboBox Combo2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "Form2.frx":0048
      Left            =   4320
      List            =   "Form2.frx":006A
      TabIndex        =   6
      Text            =   "9600"
      Top             =   360
      Width           =   1095
   End
   Begin VB.ComboBox Combo1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "Form2.frx":00AC
      Left            =   1800
      List            =   "Form2.frx":00BC
      TabIndex        =   4
      Text            =   "COM1"
      Top             =   360
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "取 消"
      Height          =   375
      Left            =   3600
      TabIndex        =   3
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   375
      Left            =   1200
      TabIndex        =   2
      Top             =   2760
      Width           =   1215
   End
   Begin VB.Line Line5 
      BorderColor     =   &H00FFFF80&
      X1              =   600
      X2              =   600
      Y1              =   1080
      Y2              =   2160
   End
   Begin VB.Line Line4 
      BorderColor     =   &H00FFFF80&
      X1              =   600
      X2              =   600
      Y1              =   2040
      Y2              =   240
   End
   Begin VB.Line Line3 
      BorderColor     =   &H00FFFF80&
      X1              =   600
      X2              =   5520
      Y1              =   2160
      Y2              =   2160
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00FFFF80&
      X1              =   5520
      X2              =   5520
      Y1              =   2160
      Y2              =   240
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFFF80&
      X1              =   600
      X2              =   5520
      Y1              =   240
      Y2              =   240
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "停 止 位"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   10
      Top             =   1680
      Width           =   975
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "数 据 位"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   8
      Top             =   1080
      Width           =   975
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "波 特 率"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   5
      Top             =   360
      Width           =   975
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "校 验 位"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   720
      TabIndex        =   1
      Top             =   1080
      Width           =   1020
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   " 串  口"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   720
      TabIndex        =   0
      Top             =   360
      Width           =   855
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public comport As Integer
Public comsetting As String
Private Sub command1_Click()
Dim t As Integer
If Form1.Command6.Caption = "串口关闭" Then
   MsgBox "打开串口后才能设置!", 52, "提示"
Else
  t = Combo1.ListIndex
  Select Case t
  Case 0 Or -1
  comport = 1
  Case 1
  comport = 2
  Case 2
  comport = 3
  Case 3
  comport = 4
  End Select
  comsetting = Combo2.Text & "," & Combo3.Text & "," & Combo4.Text & "," & Combo5.Text
  Form1.Command6.Caption = "串口关闭"
  Form1.MSComm1.PortOpen = False
End If
End Sub

Private Sub Command2_Click()
comport = 1
comsetting = "9600,N,8,1"
Form1.Show
End Sub

⌨️ 快捷键说明

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