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

📄 frmpara.frm

📁 此为交通信号机
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmPara 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "参数设定"
   ClientHeight    =   4125
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5655
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4125
   ScaleWidth      =   5655
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      Height          =   495
      Left            =   3480
      TabIndex        =   11
      Top             =   3360
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "设为默认值"
      Height          =   495
      Left            =   720
      TabIndex        =   10
      Top             =   3360
      Width           =   1095
   End
   Begin VB.ComboBox Combo5 
      Height          =   300
      ItemData        =   "FrmPara.frx":0000
      Left            =   2400
      List            =   "FrmPara.frx":000D
      TabIndex        =   8
      Top             =   2760
      Width           =   1815
   End
   Begin VB.ComboBox Combo4 
      Height          =   300
      ItemData        =   "FrmPara.frx":001C
      Left            =   2400
      List            =   "FrmPara.frx":0029
      TabIndex        =   7
      Top             =   2160
      Width           =   1815
   End
   Begin VB.ComboBox Combo3 
      Height          =   300
      ItemData        =   "FrmPara.frx":0041
      Left            =   2400
      List            =   "FrmPara.frx":004B
      TabIndex        =   5
      Top             =   1560
      Width           =   1815
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      ItemData        =   "FrmPara.frx":0055
      Left            =   2400
      List            =   "FrmPara.frx":006B
      TabIndex        =   3
      Top             =   960
      Width           =   1815
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "FrmPara.frx":0093
      Left            =   2400
      List            =   "FrmPara.frx":009D
      TabIndex        =   0
      Top             =   360
      Width           =   1815
   End
   Begin VB.Label Label5 
      Caption         =   "停止位:"
      Height          =   255
      Left            =   840
      TabIndex        =   9
      Top             =   2760
      Width           =   735
   End
   Begin VB.Label Label4 
      Caption         =   "数据位:"
      Height          =   255
      Left            =   840
      TabIndex        =   6
      Top             =   1560
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "奇偶校验:"
      Height          =   255
      Left            =   840
      TabIndex        =   4
      Top             =   2160
      Width           =   1095
   End
   Begin VB.Label Label2 
      Caption         =   "波特率:"
      Height          =   255
      Left            =   840
      TabIndex        =   2
      Top             =   960
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "端口:"
      Height          =   255
      Left            =   960
      TabIndex        =   1
      Top             =   360
      Width           =   855
   End
End
Attribute VB_Name = "FrmPara"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim sbaudrate As String
     Dim sstop As String
     Dim sdata As String
     Dim sparity As String
     Dim sport As String
     
Private Sub Command1_Click()
    
       Combo1.ListIndex = 1
       Combo2.ListIndex = 4
       Combo3.ListIndex = 0
       Combo4.ListIndex = 1
       Combo5.ListIndex = 0


End Sub

      
Private Sub Command2_Click()
          Select Case Combo1.ListIndex
            Case 0
                sport = "1"
            Case 1
                sport = "2"
          End Select
 
      
          sbaudrate = Combo2.Text
      
          Select Case Combo4.ListIndex
              Case 0
                  sparity = "O"
              Case 1
                  sparity = "E"
              Case 2
                  sparity = "N"
           End Select
           
           sdata = Combo3.Text
           
           sstop = Combo5.Text
        FrmMain.MSComm1.Settings = sbaudrate + "," + sparity + "," + sdata + "," + sstop
        FrmMain.MSComm1.CommPort = sport
        FrmPara.Hide
           
End Sub

Private Sub Form_Load()
       Combo1.ListIndex = 1
       Combo2.ListIndex = 4
       Combo3.ListIndex = 0
       Combo4.ListIndex = 1
       Combo5.ListIndex = 0
        Left = (Screen.Width - Width) / 2
        Top = (Screen.Height - Height) / 2
End Sub

⌨️ 快捷键说明

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