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

📄 frmcomset.frm

📁 回流焊监控系统-DCS,VB编写,对PLC进行通讯采集和控制,界面直观,操作方便,可以作为同类软件系统提供示范
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmComSet 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "通讯端口设置"
   ClientHeight    =   1395
   ClientLeft      =   6675
   ClientTop       =   4860
   ClientWidth     =   3090
   Icon            =   "frmComSet.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1395
   ScaleWidth      =   3090
   ShowInTaskbar   =   0   'False
   Begin VB.ComboBox cbCom 
      Height          =   300
      Left            =   1440
      TabIndex        =   3
      Text            =   "COM1"
      Top             =   240
      Width           =   1455
   End
   Begin VB.CommandButton CancelButton 
      Caption         =   "取消"
      Height          =   375
      Left            =   1680
      TabIndex        =   1
      Top             =   840
      Width           =   1215
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "确定"
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   840
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "COM通讯口:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   240
      Width           =   1095
   End
End
Attribute VB_Name = "frmComSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit

Private Sub Form_Load()
   Dim i As Long
   For i = 0 To 7
     cbCom.AddItem "COM" & i + 1
   Next
   cbCom.ListIndex = 0
End Sub

Private Sub OKButton_Click()
  On Error GoTo Errhandle
  frmMain.PLC1.PortOpen = False
  frmMain.PLC1.Port = cbCom.ListIndex + 1
  frmMain.PLC1.PortOpen = True
  Call CancelButton_Click
  Exit Sub
Errhandle:
  frmMain.sbStatusBar.Panels(1).Text = Err.description
  Err.Clear
End Sub
Private Sub Form_Activate()
SetDlgBackColor Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call CancelButton_Click
Cancel = 1
End Sub
Private Sub CancelButton_Click()
Me.Hide
frmMain.Enabled = True
End Sub

⌨️ 快捷键说明

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