亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? frmmain.frm

?? 很好的Kepware的VB的OPC Client例子.
?? FRM
?? 第 1 頁 / 共 5 頁
字號:
                ' selected group.  If its not then we need to update the
                ' lvListView with a new list of items if they exist.
                If (Not NewGroupSelection Is Module1.SelectedOPCGroup) Then
                    ' A new group has been selected so we need to dump the current
                    ' list view and load a new one.
                    Set Module1.SelectedOPCGroup = NewGroupSelection
                    ' Dump the current listview contents and try to load
                    ' the items from the newly selected group if any.
                    GetNewItemList
                End If
                          
                ' Enable/Disable those option for a group selection
                mnuTreeViewNewServer.Visible = False ' Disable New Server
                mnuTreeViewNewServer.Enabled = False
                mnuTreeViewNewGroup.Visible = False     'Disable New Group
                mnuTreeViewNewGroup.Enabled = False
                mnuTreeViewDelete.Visible = True        ' Enable delete of group
                mnuTreeViewDelete.Enabled = True
                mnuTreeViewProperties.Visible = True    ' Enable view of group properties
                mnuTreeViewProperties.Enabled = True
                mnuTreeViewNewItem.Visible = True       ' Enable add item.
                mnuTreeViewNewItem.Enabled = True
            End If
        Else ' If no node was selected but the user right clicked then
             ' display the popup with only the "New Server Connection" enabled
            mnuTreeViewNewGroup.Visible = False
            mnuTreeViewNewGroup.Enabled = False
            mnuTreeViewDelete.Visible = False
            mnuTreeViewDelete.Enabled = False
            mnuTreeViewProperties.Visible = False
            mnuTreeViewProperties.Enabled = False
            mnuTreeViewNewItem.Visible = False
            mnuTreeViewNewItem.Enabled = False
        End If
        
        ' Show the TreeView popup.
        frmMain.PopupMenu mnuTreeView
        
    ' The left button is used to select and OPC server connection
    ' or group only no popup is displayed.
    ElseIf (Button = vbLeftButton) Then
        If Not SelectedNode Is Nothing Then
            If InStr(SelectedNode.Key, "Server") Then
                ' Get the selected OPCServerClass object using the
                ' SelectedNode.Key which is the same as the server key
                ' in the OPCServers collection.
                With OPCServers
                    Set Module1.SelectedOPCServer = .Item(SelectedNode.Key)
                End With
                ' When a server is selected we set the Module1.SelectedOPCGroup
                ' to nothing and clear the lvListView control.
                Set Module1.SelectedOPCGroup = Nothing
                lvListView.ListItems.Clear
            ElseIf InStr(SelectedNode.Key, "Group") Then
                ' Get a reference to the parent of group node.
                Set NodParent = SelectedNode.Parent
                ' Set the Selected Server to this parent
                With OPCServers
                    Set Module1.SelectedOPCServer = .Item(NodParent.Key)
                End With
                
                ' See explanation in the right click portion above.
                Set OPCServerGroupsCls = Module1.SelectedOPCServer.GetOPCServerGroupCollection
                Set NewGroupSelection = OPCServerGroupsCls.Item(SelectedNode.Key)
                If (Not NewGroupSelection Is Module1.SelectedOPCGroup) Then
                    ' A new group has been selected so we need to dump the current
                    ' list view and load a new one.
                    Set Module1.SelectedOPCGroup = NewGroupSelection
                    GetNewItemList
                End If
            End If
        End If
    
    End If
End Sub


' This sub is invoked from the mnuTreeView popup context menu
' and simply displays the frmSelectOPCServer form.
'
Private Sub mnuTreeViewNewServer_Click()
    Load frmSelectOPCServer
    frmSelectOPCServer.Show
    ' Prevent the tree view from being selected while the server
    ' selection menu is displayed.
    '
    ' You'll see that I check this property in the lvListView_MouseUp
    ' as a simple way of preventing user input in the listview without
    ' using the .Enabled property of the ListView which cause the
    ' whole thing to grey out.
    tvTreeView.Enabled = False
End Sub


' This sub is invoked from the mnuTreeView popup context menu
' and simply displays the frmAddGroup form.
'
Private Sub mnuTreeViewNewGroup_Click()
    Load frmAddGroup
    frmAddGroup.Show
    ' Prevent the tree view from being selected while the server
    '  selection menu is displayed
    '
    ' You'll see that I check this property in the lvListView_MouseUp
    ' as a simple way of preventing user input in the listview without
    ' using the .Enabled property of the ListView which cause the
    ' whole thing to grey out.
    tvTreeView.Enabled = False
End Sub


' This sub is invoked from the mnuTreeView popup context menu
' and simply displays the frmAddItem form. This is only
' available when a group is selected from the tvTreeView control.
' Since this is the sane as the ListView action I use that sub.
'
Private Sub mnuTreeViewNewItem_Click()
    ' Simply call the list view handler here to add a new item to the
    ' seleted group.
    mnuListViewNewItem_Click
End Sub


' This sub is invoked from the mnuTreeView popup context menu
' and simply displays either the Server properties form or the
' Group properties form.
'
Private Sub mnuTreeViewProperties_Click()
    ' In this case we know that the only way this menu could
    ' have been invoked is when a treeview node has been selected
    ' so we can simply test the tvTreeView.SelectedItem.Key for
    ' either the "Server" portion or "Group" portion of the key.
    If InStr(tvTreeView.SelectedItem.Key, "Server") Then
        Load frmOPCServerProperties
        frmOPCServerProperties.Show
    ElseIf InStr(tvTreeView.SelectedItem.Key, "Group") Then
        Load frmOPCGroupProperties
        frmOPCGroupProperties.Show
    End If
    ' Prevent the tree view from being selected while the properties
    ' menu is displayed.
    '
    ' You'll see that I check this property in the lvListView_MouseUp
    ' as a simple way of preventing user input in the listview without
    ' using the .Enabled property of the ListView which cause the
    ' whole thing to grey out.
    tvTreeView.Enabled = False
End Sub


' Up to this point the subs called from the mnuTreeView popup menu have simply
' invoked other VB forms.  The delete menu selection has a direct effect
' upon the state of you OPC data.  The mnuTreeViewDelete_Click will either
' delete the selected OPCServerClass object from the OPCServers
' collection and treeview or delete the selected OPCGroupClass from the
' selected OPCServerClass object.  In both cases the TreeView and ListView
' will also be updated accordingly.  This must be done to keep the node keys
' in sync with the OPC server and group object keys.
'
Private Sub mnuTreeViewDelete_Click()
    On Error GoTo SkipDelete
    ' Is the selected node in the treeview a server object?
    If InStr(tvTreeView.SelectedItem.Key, "Server") Then
        ' When removing the entire server from the system
        ' we first need to remove the groups that are part
        ' of that server.  We can do this by using the
        ' OPCServerGroups collection that is part of the OPCServerClass object
        ' The Groups are removed in reverse order as the collection
        ' shrinks this is important since the size of the collection goes down
        ' and the numerical indexes are adjust as you delete objects from
        ' the collection.
        
        Dim OPCServerGroupCls As Collection
        Set OPCServerGroupCls = Module1.SelectedOPCServer.GetOPCServerGroupCollection
        
        ' If there are groups in this server remove them from the OPCServerClass
        ' object and from the treeview.
        If OPCServerGroupCls.Count <> 0 Then
            Dim i As Integer
            Dim a As Integer
            Dim GroupKeyToRemove As String
            a = OPCServerGroupCls.Count ' intialize the count used when removing the objects in reverse order.
            For i = 1 To OPCServerGroupCls.Count
                Set Module1.SelectedOPCGroup = OPCServerGroupCls.Item(a)
                ' Get the group object key as a string
                GroupKeyToRemove = Module1.SelectedOPCGroup.GetGroupKey
                ' Remove the object from the OPCServerClass object's
                ' collection of group objects.
                Module1.SelectedOPCServer.RemoveOPCGroup (GroupKeyToRemove)
                tvTreeView.Nodes.Remove (GroupKeyToRemove)
                Set Module1.SelectedOPCGroup = Nothing
                a = a - 1
            Next i
        End If
        
        ' Clear the list view for this group
        lvListView.ListItems.Clear
                
        ' Now that all the groups have been removed from the OPCServerClass
        ' object we can disconnect the server from our application.  This
        ' is done by calling the DisconnectOPCServer function of the
        ' OPCServerClass object.
        Module1.SelectedOPCServer.DisconnectOPCServer
        
        ' Now we remove the OPCServerClass object itself from the
        ' the OPCServers collection.
        With OPCServers
            .Remove (tvTreeView.SelectedItem.Key)
        End With
        ' Finally we remove the server connection from the treeview.
        tvTreeView.Nodes.Remove (tvTreeView.SelectedItem.Key)
        ' clear the SelelctedOPCServer pointer.
        Set Module1.SelectedOPCServer = Nothing
     
    ' Removing the group object from a server object is a little easier
    ' since we don't need to do any looips to remove a list of groups
    ' from the OPCServerClass object or treeview.
    
    ElseIf InStr(tvTreeView.SelectedItem.Key, "Group") Then
        Dim Result As Boolean
        ' Atempt to remove the selected OPCGroupClass object from the
        ' selected OPCServerClass object by calling the RemoveOPCGroup method
        ' of the OPCServerClass object.
        Result = Module1.SelectedOPCServer.RemoveOPCGroup(tvTreeView.SelectedItem.Key)
        
        ' If the remove was sucessful remove the group from the treeview
        ' and clear the listview control.
        If Result = True Then
            Set Module1.SelectedOPCGroup = Nothing
            tvTreeView.Nodes.Remove (tvTreeView.SelectedItem.Key)
            lvListView.ListItems.Clear
        End If
    End If
SkipDelete:
End Sub


' The GetNewItemList sub handles loading a new list view with OPC
' items from the selected OPCGroupClass object.  This occurs
' whenever the user selects a new group from the treeview.
'
Private Sub GetNewItemList()
    On Error Resume Next
    ' First clear the existing list view
    lvListView.ListItems.Clear
    LastTopItem = -1
    
    Dim OPCItemData As OPCItemClass
    Dim OPCGroupItemsCls As Collection
    ' Get pointer to the collection of items in the OPCGroupClass object.
    Set OPCGroupItemsCls = Module1.SelectedOPCGroup.GetOPCGroupItemsCollection
    
    ' If there are no items exit
    If OPCGroupItemsCls.Count = 0 Then
        GoTo SkipListUpdate
    End If
     
    Dim i As Integer
    
    For i = 1 To OPCGroupItemsCls.Count
        ' Normally we use the "Item Key" as string to specify the item we want
        ' from the collection but in this case we don't know the item keys
        ' explicitly sense some items may have been deleted.  To
        ' address this we can use the item index as a numeric index
        ' then pull the item key from the OPCItemData and use this as
        ' our list view key.  This demonstrates how both the string key
        '  and the numeric key of a collection can be used to address
        ' what otherwise would be a real key management issue.
        
        ' Get an OPCItemClass object from the items collection
        Set OPCItemData = OPCGroupItemsCls.Item(i)
        
        Dim ItemKey As String
        Dim itmX As ListItem
        Dim Quality As Long
        Dim ItemValue As Variant
        
        ' Build a unique strin key for the list view item using the actual
        ' item index number.
        ItemKey = "Item" + Str(OPCItemData.GetItemIndex)
        ' Add Node objects.
        Set itmX = lvListView.ListItems.Add(, ItemKey, OPCItemData.GetItemID)
            ItemValue = OPCItemData.GetItemValue(OPCItemDirect)
            ' When not processing an array value then simply display
            ' the value as it is in variant form.
            If Not IsArray(ItemValue) Then
                itmX.SubItems(1) = ItemValue
            Else
                ' If we have an array then we need to format the display
                ' by converting the value to a string with each value
                ' separated by commas.
                Dim b As Integer
                itmX.SubItems(1) = ""
                ' Regardless of the Option Base setting arrays returned

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国产丝袜在线播放| 在线一区二区三区做爰视频网站| 亚洲精品视频在线| 精品日韩欧美一区二区| 91成人免费网站| 国产乱码精品一品二品| 亚洲一区二区三区美女| 中文字幕精品一区二区精品绿巨人 | 国产精品亚洲一区二区三区在线| 中文字幕亚洲不卡| 精品成人a区在线观看| 欧美日韩国产影片| 成人av免费在线观看| 国产一区二三区好的| 另类综合日韩欧美亚洲| 亚洲一区二区三区视频在线播放 | 懂色av中文一区二区三区| 五月天亚洲婷婷| 国产精品国模大尺度视频| 精品国产髙清在线看国产毛片| 欧美午夜精品一区| 色噜噜狠狠色综合欧洲selulu| 国产传媒欧美日韩成人| 精品无码三级在线观看视频| 日韩成人午夜电影| 亚洲一区二区3| 亚洲精品国产无天堂网2021| 欧美国产日韩在线观看| 国产欧美日韩另类一区| 日韩你懂的电影在线观看| 欧美久久免费观看| 欧美视频日韩视频| 欧美视频在线观看一区| 欧美视频在线观看一区| 欧美日韩精品系列| 欧美乱妇15p| 欧美老年两性高潮| 欧美丰满嫩嫩电影| 欧美美女网站色| 日韩女优制服丝袜电影| 欧美不卡在线视频| 久久久国产精品麻豆| 久久综合九色欧美综合狠狠| 国产亚洲福利社区一区| 香蕉加勒比综合久久| 亚洲v中文字幕| 青青草国产成人av片免费| 日本麻豆一区二区三区视频| 日本成人在线看| 蜜臀a∨国产成人精品| 经典三级视频一区| 成人午夜视频网站| 99国产精品久久久久久久久久| 91在线免费看| 欧美又粗又大又爽| 在线不卡一区二区| 精品国产一二三| 国产日韩欧美精品在线| 亚洲图片你懂的| 亚洲一区二区三区四区在线观看 | 成人午夜伦理影院| 日本精品视频一区二区| 欧美日韩国产一级| 欧美刺激午夜性久久久久久久| 精品久久久久久久久久久久包黑料 | 综合电影一区二区三区| 一区二区三区在线视频免费观看| 亚洲午夜精品久久久久久久久| 偷窥少妇高潮呻吟av久久免费| 蜜乳av一区二区| 韩国毛片一区二区三区| 91一区一区三区| 欧美丰满美乳xxx高潮www| 久久久www成人免费无遮挡大片| 国产精品白丝在线| 日韩在线a电影| 成人免费视频视频在线观看免费| 欧美性猛交xxxxxxxx| 精品久久一区二区| 亚洲精品你懂的| 国产一区不卡精品| 欧美三级三级三级爽爽爽| 欧美xxxxx裸体时装秀| 亚洲精品视频在线观看免费| 精品中文字幕一区二区小辣椒| a在线播放不卡| 欧美一区二区三区视频| 国产精品国产自产拍高清av王其 | 亚洲视频一区二区在线| 天天影视涩香欲综合网| 国产成人av一区二区三区在线观看| 一道本成人在线| 久久影院视频免费| 午夜激情一区二区三区| 成人激情视频网站| 精品国偷自产国产一区| 亚洲制服丝袜av| 国产91精品免费| 日韩美女视频在线| 亚洲成人自拍网| 99re8在线精品视频免费播放| 日韩一卡二卡三卡四卡| 怡红院av一区二区三区| 国产不卡在线视频| xnxx国产精品| 日韩国产在线观看一区| 色婷婷久久综合| 国产精品免费久久| 国产在线播精品第三| 欧美日韩夫妻久久| 亚洲激情网站免费观看| 成人一区二区视频| 久久久三级国产网站| 免费高清不卡av| 欧美日韩国产一二三| 1024成人网| aa级大片欧美| 亚洲国产成人午夜在线一区| 国产一二精品视频| 欧美一区二区三区视频在线观看 | 精品一区二区三区免费| 欧美日本精品一区二区三区| 亚洲免费电影在线| 91丨porny丨中文| 国产精品久久三| 国产999精品久久久久久| 精品剧情在线观看| 精品在线播放免费| 日韩亚洲欧美在线观看| 日韩高清一级片| 欧美一区二区免费观在线| 亚洲超丰满肉感bbw| 欧美色图免费看| 午夜精品久久一牛影视| 欧美日韩成人一区二区| 午夜国产精品影院在线观看| 欧美久久久久久久久| 午夜婷婷国产麻豆精品| 欧美日韩国产三级| 三级亚洲高清视频| 3atv在线一区二区三区| 奇米精品一区二区三区在线观看一| 欧美一区二区三区在线| 九九国产精品视频| 国产三级久久久| av成人动漫在线观看| 亚洲激情自拍偷拍| 欧美日韩精品一区二区三区蜜桃| 日本aⅴ精品一区二区三区 | 欧美亚洲国产一区二区三区 | 亚洲精品视频在线观看免费| 在线精品视频小说1| 丝袜a∨在线一区二区三区不卡 | 日韩欧美精品在线视频| 久久精品国产一区二区三区免费看| 欧美成人aa大片| 成人精品视频一区二区三区| 亚洲免费观看高清| 欧美美女一区二区在线观看| 国内精品第一页| 国产精品久久久久久久午夜片| 91原创在线视频| 亚洲国产sm捆绑调教视频 | 3d动漫精品啪啪一区二区竹菊| 久久99国产精品麻豆| 中文字幕av一区二区三区高| 91久久一区二区| 精品一区二区三区在线观看 | 国产精品久久久久久久浪潮网站| 91国在线观看| 国产又黄又大久久| 亚洲美女一区二区三区| 制服.丝袜.亚洲.中文.综合| 国产精品伊人色| 亚洲午夜av在线| 久久亚洲精华国产精华液| 日本黄色一区二区| 紧缚捆绑精品一区二区| 一区二区三区视频在线观看| 日韩欧美在线综合网| 成人激情免费网站| 美女国产一区二区三区| 国产精品乱人伦中文| 91麻豆精品国产91久久久资源速度| 国产成人精品综合在线观看 | 日韩一区在线看| 欧美一区二区三区婷婷月色| 99国产精品久久久久久久久久久| 欧美在线短视频| 成人免费毛片片v| 免费精品视频最新在线| |精品福利一区二区三区| 精品99999| 在线这里只有精品| 成人的网站免费观看| 理论片日本一区| 性做久久久久久免费观看| 国产精品美女久久久久aⅴ| 欧美一区二区日韩一区二区| 色狠狠一区二区三区香蕉|