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

📄 viewdata.frm

📁 该程序基于RS232串口通讯的激光检测钻头钻孔内径及外径等相关参数从而判断该产品是否为OK/NG
💻 FRM
字号:
VERSION 5.00
Begin VB.Form communication 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "通讯设置---"
   ClientHeight    =   4065
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3645
   Icon            =   "viewdata.frx":0000
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4065
   ScaleWidth      =   3645
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame2 
      Caption         =   "RS-232 :"
      Height          =   3975
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   3615
      Begin VB.CommandButton Command3 
         Caption         =   "默认设置"
         Height          =   375
         Left            =   1320
         TabIndex        =   13
         Top             =   3240
         Width           =   975
      End
      Begin VB.CommandButton Command2 
         Caption         =   "退出"
         Height          =   375
         Left            =   2400
         TabIndex        =   12
         Top             =   3240
         Width           =   1095
      End
      Begin VB.CommandButton Command1 
         Caption         =   "保存"
         Height          =   375
         Left            =   240
         TabIndex        =   11
         Top             =   3240
         Width           =   975
      End
      Begin VB.ComboBox Combo5 
         Height          =   315
         Left            =   1560
         TabIndex        =   10
         Text            =   "Even"
         Top             =   2520
         Width           =   1095
      End
      Begin VB.ComboBox Combo4 
         Height          =   315
         Left            =   1560
         TabIndex        =   9
         Text            =   "1"
         Top             =   2040
         Width           =   1095
      End
      Begin VB.ComboBox Combo3 
         Height          =   315
         Left            =   1560
         TabIndex        =   8
         Text            =   "8"
         Top             =   1560
         Width           =   1095
      End
      Begin VB.ComboBox Combo2 
         Height          =   315
         Left            =   1560
         TabIndex        =   7
         Text            =   "115200"
         Top             =   1080
         Width           =   1095
      End
      Begin VB.ComboBox Combo1 
         Height          =   315
         Left            =   1560
         TabIndex        =   6
         Text            =   "1"
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "校验位:"
         Height          =   195
         Left            =   660
         TabIndex        =   5
         Top             =   2640
         Width           =   720
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "停止位:"
         Height          =   195
         Left            =   660
         TabIndex        =   4
         Top             =   2160
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "数据长度:"
         Height          =   195
         Left            =   480
         TabIndex        =   3
         Top             =   1680
         Width           =   900
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "速率:"
         Height          =   195
         Left            =   840
         TabIndex        =   2
         Top             =   1200
         Width           =   540
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "COM端口:"
         Height          =   195
         Left            =   480
         TabIndex        =   1
         Top             =   480
         Width           =   900
      End
   End
End
Attribute VB_Name = "communication"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub Command1_Click()
On Error Resume Next
Select Case Combo2.Text
      Case "115200"
          Combo2.Text = "115200"
       Case "57600"
          Combo2.Text = "57600"
       Case "38400"
          Combo2.Text = "38400"
        Case "19200"
          Combo2.Text = "19200"
        Case "9600"
        Combo2.Text = "9600"
     Case Else
        Combo2.Text = "115200"
End Select

Select Case Combo3.Text
      Case "8"
        Combo3.Text = "8"
        Case "7"
        Combo3.Text = "7"
        Case Else
        Combo3.Text = "8"
 End Select
 
 Select Case Combo4.Text
     Case "1"
        Combo4.Text = 1
      Case "2"
        Combo4.Text = 2
        Case Else
         Combo4.Text = 1
End Select

Select Case Combo5.Text

End Select
SaveSetting "myapp", "c1", "value", Combo1.Text
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Combo1.ListIndex = 0
Combo2.ListIndex = 0
Combo3.ListIndex = 0
Combo4.ListIndex = 0
Combo5.ListIndex = 1
End Sub

Private Sub Form_Load()

Dim i As Integer
   For i = 1 To 16
      Combo1.AddItem i
      Next i
    
    
    Combo2.AddItem "115200"
    Combo2.AddItem "57600"
    Combo2.AddItem "38400"
    Combo2.AddItem "19200"
    Combo2.AddItem "9600"
    
    Combo3.AddItem "8"
    Combo3.AddItem "7"
    
    Combo4.AddItem "1"
    Combo4.AddItem "2"
    
    Combo5.AddItem "None"
    Combo5.AddItem "Even"
    Combo5.AddItem "Odd"
    
    
    
    
    
End Sub





⌨️ 快捷键说明

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