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

📄 opcserveruserinterface.frm

📁 opc 通讯 册测试通讯OPC使用 客户端/服务端
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSelectOPCServer 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "OPC Server 列表"
   ClientHeight    =   4020
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5775
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4020
   ScaleWidth      =   5775
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton AbortConnection 
      Caption         =   "取消"
      Height          =   375
      Left            =   4320
      TabIndex        =   3
      ToolTipText     =   "Click here to abort making a selection at this time"
      Top             =   3600
      Width           =   1335
   End
   Begin VB.CommandButton ConnectToOPCServer 
      Caption         =   "联接到服务器"
      Height          =   375
      Left            =   1410
      TabIndex        =   2
      ToolTipText     =   "Click here to attempt a connection to the selected OPC server"
      Top             =   3600
      Width           =   2415
   End
   Begin VB.TextBox SelectedOPCServer 
      Height          =   285
      Left            =   120
      TabIndex        =   1
      Text            =   "No Server Selected"
      ToolTipText     =   "Select an OPC server from the list above or enter a Prog ID here"
      Top             =   3240
      Width           =   5535
   End
   Begin VB.ListBox OPCServerList 
      Height          =   2940
      Left            =   120
      TabIndex        =   0
      ToolTipText     =   "Click on one of the available OPC servers listed here"
      Top             =   120
      Width           =   5535
   End
End
Attribute VB_Name = "frmSelectOPCServer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1

Private Sub Form_Load()
    Dim OPCServer As OPCServerClass
    Set OPCServer = New OPCServerClass

    Dim ServerList As Variant

    OPCServer.GetOPCServerList ServerList
    OPCServerList.Clear
    Dim I As Integer
    For I = LBound(ServerList) To UBound(ServerList)
        OPCServerList.AddItem ServerList(I)
    Next I
    Set OPCServer = Nothing
End Sub


Private Sub AbortConnection_Click()
    fMainForm.tvTreeView.Enabled = True
    Unload Me
End Sub

Private Sub ConnectToOPCServer_Click()
    If (SelectedOPCServer.Text = "No Server Selected") Then
        MsgBox "Please select an OPC Server from the list or enter a Prog ID."
    Else
        fMainForm.AddSelectedOPCServerMain SelectedOPCServer.Text
        fMainForm.tvTreeView.Enabled = True
        Unload Me
    End If
End Sub

Private Sub Form_Deactivate()
    frmSelectOPCServer.Show
End Sub

Private Sub OPCServerList_Click()
    SelectedOPCServer.Text = OPCServerList.List(OPCServerList.ListIndex)
End Sub

⌨️ 快捷键说明

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