opcgeneral.pag

来自「关于OPC的相关资料:OPC技术介绍.pdf,入门学习资料及VB源码」· PAG 代码 · 共 91 行

PAG
91
字号
VERSION 5.00
Begin VB.PropertyPage OPCGeneral 
   Caption         =   "OPC设置"
   ClientHeight    =   2472
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   6576
   LockControls    =   -1  'True
   PaletteMode     =   0  'Halftone
   ScaleHeight     =   2472
   ScaleWidth      =   6576
   Begin VB.CheckBox chkAutoLink 
      Caption         =   "自动连接(&A)"
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   840
      Width           =   3015
   End
   Begin VB.TextBox txtProgID 
      Height          =   270
      Left            =   240
      TabIndex        =   1
      Top             =   360
      Width           =   2970
   End
   Begin VB.TextBox txtItemID 
      Height          =   270
      Left            =   3360
      TabIndex        =   0
      Top             =   360
      Width           =   2970
   End
   Begin VB.Label lblProgID 
      Caption         =   "程序标识符(&P):"
      Height          =   255
      Left            =   240
      TabIndex        =   3
      Top             =   120
      Width           =   2970
   End
   Begin VB.Label lblItemID 
      Caption         =   "项标识符(&I):"
      Height          =   255
      Left            =   3360
      TabIndex        =   2
      Top             =   120
      Width           =   2970
   End
End
Attribute VB_Name = "OPCGeneral"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Private Sub PropertyPage_ApplyChanges()
    Dim objControl As Object
    For Each objControl In SelectedControls
        objControl.ProgID = txtProgID.Text
        objControl.ItemID = txtItemID.Text
        If chkAutoLink.Value = 0 Then
            objControl.AutoLink = False
        Else
            objControl.AutoLink = True
        End If
    Next
End Sub

Private Sub PropertyPage_SelectionChanged()
    ' 初始化
    txtProgID.Text = SelectedControls(0).ProgID
    txtItemID.Text = SelectedControls(0).ItemID
    If SelectedControls(0).AutoLink Then
        chkAutoLink.Value = 1
    Else
        chkAutoLink.Value = 0
    End If
End Sub

Private Sub txtProgID_Change()
    Changed = True
End Sub

Private Sub txtItemID_Change()
    Changed = True
End Sub

Private Sub chkAutoLink_Click()
    Changed = True
End Sub

⌨️ 快捷键说明

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