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

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

?? frmmain.frm

?? vb開發的一個opcclient源代碼
?? FRM
?? 第 1 頁 / 共 5 頁
字號:
         Caption         =   "-"
      End
      Begin VB.Menu mnuListViewDelete 
         Caption         =   "&Delete"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' The main form frmMain is the central user interface focal point
' for this example application. While all of the actual OPC
' interface code is contained in the three class modules
' OPCServerClass, OPCGroupClass, and OPCItemClass, the use
' of these classes is demostrated primarily in this module.
' Think of this module as being the basis for your own OPC
' application.  While your application may not have the same
' user interface requirements, the mechanisms for adding server
' connections, groups, and items is the same.  One thing to
' keep in mind is that while this example applicaiton
' demonstrates the various OPC elements driven by User input
' your application can do all of these steps programtically,
' or via configuration files, or database contents.
'
' The primary bodies of code in this form deal with managing
' user interaction with the tvTreeView and lvListView controls
' on this form.  That management includes maintaining the
' OPC server, group, and item objects stored in these views.
' As you add server connections, groups and items, both the
' class modules and the TreeView and ListView controls are kept in
' sync with these item.  Simply put the TreeView and ListView
' contain a collection of objects but the OPC class modules
' keep their own list so you don't need to have any user interface
' elements for your own OPC application.
'
' As part of managing the user interface, the frmMain module
' also handles determining what OPC server, group or item has been
' selected by the user.  Once determined the three variables in
' Module1.bas,  SelectedOPCServer, SelectedOPCGroup,
' and SelectedOPCItem will be set accordingly.  These variables
' are important in other parts of this example application.  While
' not used in the three class modules, these variables are used in
' the other VB forms of this application to determine what object
' the user has selected for modification or use.
'
' One important element of how the user interface interface for
' this example is the use of the key string used on the Node
' items for the tvTreeView and on the ListItems for the lvListView.
' These key have been given very specific names with a number. In the
' TreeView there are two types of keys by name "Server X" and
' "Group X Y".  For the server key the Key always contains the word
' "Server" plus some number.  For group items the Key always
' contains the word "Group" plus a group number and the server
' number.  For this example it is crucial that these not be changed
' as all object selection is based on using these key to identify
' selected  object.  I give more detail below but it worth mentioning
' the now due to its importance.
'
' Only this form contains a menu bar.  If you have already run the
' application you have seen that there is very little in the menus.
' If you look at the menu bar in the menu editor you will see that
' there a great deal of hidden(popup) menus.  These popup menus are
' invoked by right clicking in either the tvTreeView or the lvListView.
' These right click context menus are used as the primary method of user
' interaction within the application.  Normally you would mimic these
' menus on the menu bar and I would have as well but you then must
' also take care of enabling and disabling them as needed.  I felt that
' the extra code would have clouded the application so I provide
' only the context menus.
'
' At the end of this module is some code generated by the VB app
' wizard, I have placed this code at the end of this module.
' It deals with the resizing of the this applications client
' space but has nothing to do with OPC connectivity.


Option Explicit
Option Base 1

' These variables are used in the standard code generated by
' VB to handle moving the splitter bar on the this form.
Dim mbMoving As Boolean
Const sglSplitLimit = 500
Dim LastTopItem As Integer


' On form load we need to get the last size of the application we
' also need to add the heading to the lvListView control.
'
Private Sub Form_Load()
    Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
    Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
    Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 7500)
    Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
    
    ' Add the three OPC heading to the lvListView control
    ' The ItemID is the fully qualified Item identification string
    ' for an OPC item.  The Value heading is the current value
    ' of the item. The Status heading is Quality value of the
    ' OPC item.
    lvListView.ColumnHeaders.Add , , "ItemID", lvListView.Width / 3
    lvListView.ColumnHeaders.Add , , "Value", lvListView.Width / 3
    lvListView.ColumnHeaders.Add , , "Status", lvListView.Width / 3
    lvListView.View = lvwReport ' Place list view text report mode
    
    ' This variable is used to determine when the user is attempting
    ' to scroll the OPC Item window.  When the window is scrolled the
    ' currently selected OPC Item must be deselected to allow the
    ' scroll beyond the selected item.  If the selection isn't cleared
    ' the ListView control won't allow the list to be scrolled.  Normally
    ' you don't notice this because the list view isn't normally being
    ' updated continuously.
    LastTopItem = -1
End Sub


' The unload forms sub handles cleaning up for the application.
' From an OPC standpoint it releases each OPCServerClass object
' contained in the OPCServers collection.  Due to the design of
' the OPCServerClass object it in turn releases any OPC groups
' and items those groups may contain.
'
' This is a good catch all for your application but normally
' you should not rely on this call to cleanup your OPC connections.
' The best practice is to specifically release the OPC items from
' your groups then release the groups from your servers and finally
' disconnect the OPC servers from your application.  This will be
' demonstated in the various delete functions for each of the
' objects.
'
Private Sub Form_Unload(Cancel As Integer)
    Dim i As Integer

    ' When exiting your application you should ensure that all
    ' groups and items are removed from the OPCServer objects
    ' then remove the OPCServer objects. The OPCServerClass
    ' contains a cleanup section in its terminate routine that
    ' will remove all groups and items from the class when the
    ' object is deleted. As we remove OPCServerClass object from
    ' the OPCServers collection this terminate function is called
    ' automatically removing We still need to remove the
    ' OPCServerGroups collection that contains the
    ' OPCGroupClasss objects ourselves.
    If OPCServers.Count <> 0 Then
        Dim a As Integer
        a = OPCServers.Count
        For i = 1 To OPCServers.Count
            With OPCServers
                ' Make sure we disconnect from server before we remove it
                Set Module1.SelectedOPCServer = .Item(a)
                Module1.SelectedOPCServer.DisconnectOPCServer
                .Remove (a)
                a = a - 1
            End With
        Next i
    End If
            
    ' Close all sub forms
    For i = Forms.Count - 1 To 1 Step -1
        Unload Forms(i)
    Next
    
    ' Save the current size of the application for the next load but
    ' only if the application is not in a minimized state.
    If Me.WindowState <> vbMinimized Then
        SaveSetting App.Title, "Settings", "MainLeft", Me.Left
        SaveSetting App.Title, "Settings", "MainTop", Me.Top
        SaveSetting App.Title, "Settings", "MainWidth", Me.Width
        SaveSetting App.Title, "Settings", "MainHeight", Me.Height
    End If
End Sub


Private Sub tvTreeView_Collapse(ByVal Node As ComctlLib.Node)
    ' When a server is selected we set the Module1.SelectedOPCGroup
    ' to nothing and clear the lvListView control.
    Set Module1.SelectedOPCGroup = Nothing
    ' Clear the current view of tags if any.
    lvListView.ListItems.Clear
    
End Sub

' This sub is the primary focal point for user interaction with the
' OPC server and goup objects. Depending on where you click within the
' tree view you will be presented with differing context menus that will
' allow you to add new servers, add new groups, view the properties of
' these objects or delete them.  Clicking within this view also allows
' you to select different objects and change the data you see in the
' lvListView control.
'
Private Sub tvTreeView_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ' The SelectedNode var is used to hold the Node item returned from
    ' the HitTest
    Dim SelectedNode As Node
    ' When the selected node is group node this var will be used to
    ' hold the parent node of the selected group, ie. what server the group
    ' belongs to.
    Dim NodParent As Node
    ' Once a group and server are determined the NewGroupSelection is used
    ' to hold the selected group.  This is then testing against the
    ' Module1.SelectedOPCGroup variable.  If they differ then a new
    ' lvListView list will potentially be build by the GetNewItemList
    ' function.  This allows you to select different groups and see
    ' the items for these groups in the lvListView control.
    Dim NewGroupSelection As OPCGroupClass

    ' Used to temporary provide access to the group collection of
    ' the OPCServerClass object pointed to by Module1.SelectedOPCServer.
    Dim OPCServerGroupsCls As Collection



    ' Determine if the user has selected a node form the tree view.
    Set SelectedNode = tvTreeView.HitTest(X, Y)

    ' Right button actions select server and group object and
    ' display the various context menus.
    If (Button = vbRightButton) Then
        ' In all cases the "New Server Connection" menu selection
        ' is available.
        mnuTreeViewNewServer.Visible = True
        mnuTreeViewNewServer.Enabled = True
        
        ' If the user has selected a node as indicated by
        ' SelectedNode not being nothing then determine what type
        ' of node was selected.  This is where the Key name I mention
        ' in the start of this module really comes into play.  By
        ' knowing that all server nodes have the word "Server" as part
        ' of their Key and all group nodes have the word "Group" as part
        ' of their Key we can easily determine what type of node the user
        ' has selected.
        If Not SelectedNode Is Nothing Then
            ' Check for a server node
            If InStr(SelectedNode.Key, "Server") Then
                ' When we get to the AddSelectedOPCServer function
                ' you will see that I also use this same KEY within
                ' in the OPCServers collection to key the server.
                ' This make selection of the server from the collection
                ' as easy as what you see in the next three lines.
                ' In your application you can of course use any keying
                ' methodology you desire as long as their unique and
                ' you manage them.
                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
                
                ' Now enable all of the options that the user can use when
                ' a server connection has been selected.
                mnuTreeViewNewGroup.Visible = True ' Add group allowed
                mnuTreeViewNewGroup.Enabled = True
                mnuTreeViewDelete.Visible = True    ' Deleted the Server
                mnuTreeViewDelete.Enabled = True
                mnuTreeViewProperties.Visible = True 'Display Server Properties
                mnuTreeViewProperties.Enabled = True
                mnuTreeViewNewItem.Visible = False   ' New Items can't be added at this time
                mnuTreeViewNewItem.Enabled = False
                
            ' If a server hasn't neen selected then it must be a group
            ' node.  We test the node key just to be sure.
            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 easy stuff as
                ' long as the keys are managed and not lost.
                With OPCServers
                    Set Module1.SelectedOPCServer = .Item(NodParent.Key)
                End With
                
                ' Now that we know the server connection we need to access
                ' the OPCGroupClass collection contained in that
                ' OPCServerClass object.
                Set OPCServerGroupsCls = Module1.SelectedOPCServer.GetOPCServerGroupCollection
                ' The NewGroupSelection is simply used to test the newly
                ' selected group against a group that may already be selected.
                ' You'll notice right away that this use of the SelectedNode.Key
                ' is a little different from the simple use when selecting
                ' an OPC server.  You'll see why in the AddOPCGroupMain function
                ' below but here is the short answer.  When a node is added to the
                ' tree view control the Node.Key must be unique regardless
                ' of parent/child relationships or not.  As you'll see in the
                ' AddOPCGroupMain function the OPCServerClass.AddOPCGroup
                ' function returns a group key.  That key is specific
                ' to a single group and the server.
                Set NewGroupSelection = OPCServerGroupsCls.Item(SelectedNode.Key)
                
                ' Now that we have the OPCGroupClass object the user
                ' has selected we test to see if it is the currently

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久久久| 亚洲国产cao| 亚洲一区二区三区视频在线 | 亚洲动漫第一页| 国产毛片精品国产一区二区三区| 色爱区综合激月婷婷| 久久亚洲二区三区| 丝袜诱惑亚洲看片| 欧洲另类一二三四区| 国产精品久久久久影院亚瑟| 久久精品99国产精品| 欧美人动与zoxxxx乱| 亚洲欧美另类小说| 92精品国产成人观看免费| 日本一区二区三区电影| 久久精品久久99精品久久| 欧美日韩www| 五月天视频一区| 欧美性xxxxx极品少妇| 亚洲男人天堂av| 成人av影视在线观看| 日本一区二区成人在线| 黄色小说综合网站| 亚洲精品在线观看网站| 久久99精品国产麻豆婷婷洗澡| 69堂成人精品免费视频| 午夜伦欧美伦电影理论片| 欧美亚洲动漫精品| 亚洲成人在线网站| 欧美美女一区二区在线观看| 亚洲高清视频在线| 欧美日韩国产免费一区二区 | 在线免费观看一区| 有坂深雪av一区二区精品| 99精品视频一区二区三区| 国产精品乱码人人做人人爱| 成人av在线影院| 中文字幕亚洲精品在线观看| 99re成人精品视频| 亚洲国产中文字幕在线视频综合| 91福利国产成人精品照片| 亚洲主播在线观看| 91.com在线观看| 全国精品久久少妇| 亚洲精品一区二区在线观看| 粉嫩av一区二区三区在线播放 | 91亚洲国产成人精品一区二三| 国产精品国产三级国产普通话蜜臀| 99麻豆久久久国产精品免费| 亚洲激情av在线| 91精品午夜视频| 懂色av一区二区三区免费看| 亚洲乱码国产乱码精品精可以看 | 日韩一区欧美二区| 久久嫩草精品久久久精品 | 国产久卡久卡久卡久卡视频精品| 国产日韩欧美电影| 91福利小视频| 激情综合亚洲精品| ...xxx性欧美| 日韩午夜激情av| 成人精品国产福利| 亚洲不卡av一区二区三区| 久久综合九色综合97_久久久| 成人aa视频在线观看| 香港成人在线视频| 久久综合av免费| 欧洲在线/亚洲| 国产美女精品人人做人人爽| 又紧又大又爽精品一区二区| 2020国产精品自拍| 在线免费观看视频一区| 国精品**一区二区三区在线蜜桃 | 久久综合色之久久综合| 91黄色免费看| 国产成人免费视| 无吗不卡中文字幕| 国产精品欧美一级免费| 欧美精品在线观看一区二区| 大白屁股一区二区视频| 青青青爽久久午夜综合久久午夜| 国产精品美女久久久久久2018| 欧美一区三区二区| 91麻豆福利精品推荐| 国产乱人伦偷精品视频免下载| 亚洲高清中文字幕| 亚洲免费观看高清在线观看| 国产调教视频一区| 日韩精品一区二区三区蜜臀| 欧美日韩中文字幕一区二区| 99久久久无码国产精品| 国产呦精品一区二区三区网站| 五月天欧美精品| 亚洲国产美国国产综合一区二区| 国产精品久久久一区麻豆最新章节| 欧美成人高清电影在线| 欧美日韩国产在线播放网站| 一本大道久久精品懂色aⅴ| 国产精品一区一区| 精品一二三四区| 免费国产亚洲视频| 亚洲大片精品永久免费| 亚洲在线观看免费视频| 亚洲日本一区二区三区| 国产精品久久久久aaaa樱花| 国产婷婷色一区二区三区在线| 欧美成人猛片aaaaaaa| 日韩视频在线永久播放| 欧美一区二区三区啪啪| 91精品在线观看入口| 欧美精品xxxxbbbb| 制服视频三区第一页精品| 欧美视频精品在线观看| 欧美午夜精品久久久久久超碰 | 午夜精品福利在线| 午夜影视日本亚洲欧洲精品| 亚洲成人综合在线| 五月天国产精品| 久久99精品国产.久久久久久| 美女性感视频久久| 国产美女精品人人做人人爽| 国产成人a级片| 91伊人久久大香线蕉| 91精彩视频在线观看| 欧美一区二区三区系列电影| 日韩精品一区在线观看| 精品国产乱码久久久久久浪潮| 国产日韩欧美a| 亚洲精品老司机| 日韩精品一级二级| 国产在线视频不卡二| 大尺度一区二区| 在线观看精品一区| 欧美一区二区久久| 国产午夜精品久久| 一区二区在线电影| 久久电影国产免费久久电影| 国产高清不卡一区| 在线中文字幕一区二区| 欧美二区在线观看| 久久综合狠狠综合久久综合88| 中文字幕高清不卡| 亚洲成人综合在线| 狠狠色综合色综合网络| 成人激情免费视频| 717成人午夜免费福利电影| 久久久久久久久久电影| 国产精品盗摄一区二区三区| 午夜视频一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | av一本久道久久综合久久鬼色| 色av成人天堂桃色av| 日韩精品一区二区三区视频播放| 中文字幕不卡在线观看| 亚洲成人av中文| 成人午夜免费电影| 欧美日韩国产免费| 国产精品私房写真福利视频| 午夜精品久久久久久不卡8050| 国产91精品露脸国语对白| 欧美三级在线播放| 国产精品无码永久免费888| 天天av天天翘天天综合网色鬼国产| 国产盗摄视频一区二区三区| 欧美一卡二卡在线观看| 亚洲欧美激情小说另类| 国产寡妇亲子伦一区二区| 4438亚洲最大| 一区二区不卡在线播放 | 亚洲国产电影在线观看| 日本 国产 欧美色综合| 色婷婷精品大视频在线蜜桃视频| 精品免费国产一区二区三区四区| 一区二区三区免费观看| 国产91精品一区二区麻豆网站| 日韩午夜在线影院| 性久久久久久久久久久久| 99在线视频精品| 日本一区二区三区四区在线视频| 久久国产精品区| 欧美一区日本一区韩国一区| 亚洲在线观看免费视频| 91亚洲永久精品| 亚洲欧洲性图库| 成人性生交大片免费| 久久久精品影视| 国产成人综合自拍| 26uuu国产日韩综合| 久国产精品韩国三级视频| 在线综合视频播放| 五月婷婷激情综合网| 欧美伦理影视网| 午夜精品一区在线观看| 欧美日韩一区三区| 亚洲尤物视频在线| 在线一区二区三区做爰视频网站| 自拍偷拍国产亚洲| 91精品1区2区| 亚洲福中文字幕伊人影院| 欧美曰成人黄网|