Showing results 1 to 1 of 1

Thread: Microsoft Forms 2.0 Object Library - Multipage ActiveX in zenon

  1. #1

    Default Microsoft Forms 2.0 Object Library - Multipage ActiveX in zenon

    - in zenon, create a picture and add a dynamic element of the type "ActiveX control" in the picture, and in the properties of this element, select the Multipage control:
    Click image for larger version

Name:	ScreenShot1002.jpg
Views:	84
Size:	26.2 KB
ID:	172

    - in the VBA editor, in the menu "Extra" choose "References", and check the Microsoft Forms 2.0 Object Library:
    Click image for larger version

Name:	ScreenShot1001.jpg
Views:	70
Size:	35.9 KB
ID:	173

    - in the VBA editor, under "ThisProject" add the following code:

    Public WithEvents myMultipage As MultiPage
    Public WithEvents myAxPic As DynPicture
    
    Public Sub init_Multipage(obElem As Element)
    Dim myPage As Page
    
    Set myMultipage = obElem.AktiveX
    If myMultipage Is Nothing Then
        Exit Sub
    End If
    
    Set myPage = myMultipage.Pages.Item(0)
    If Not myPage Is Nothing Then
        myPage.Caption = "zenon"
    End If
    
    End Sub
    
    Private Sub myAxPic_Close()
    'release references to the ActiveX control when the zenon picture is closed
        If Not myMultipage Is Nothing Then
            set myMultipage = Nothing
        End If
    End Sub
    
    Private Sub Project_Active()
    'on initializing the project (runtime start / after a reload) initialize objects
    Set myAxPic = thisProject.DynPictures.Item("PicWithActiveX")
    End Sub
    
    Private Sub Project_Inactive()
    'release references, when the runtime is closed or reloaded
        If Not myMultipage Is Nothing Then
           set myMultipage = Nothing
        End If
    End Sub

    - in the VBA editor under "ModuleElement" add the following code:

    Public Sub init_Multipage(obElem As Element)
    thisProject.init_Multipage obElem
    End Sub

    - finally, at the ActiveX Element in the zenon picture, in the properties Window, add the "init_Multipage" procedure at the init event of the element:
    Click image for larger version

Name:	ScreenShot1000.jpg
Views:	74
Size:	48.7 KB
ID:	174
    Last edited by bernhardf : 19th May 2010 at 13:58

Similar Threads

  1. ActiveX Control in zenOn
    By sebastiank in forum VBA
    Replies: 2
    Last Post: 27th February 2009, 19:38
  2. ActiveX
    By hagn in forum zenon Supervisor
    Replies: 22
    Last Post: 1st April 2008, 07:17
  3. VBA and Microsoft Access
    By bjoerndavid in forum VBA
    Replies: 2
    Last Post: 30th November 2007, 22:22
  4. Replies: 0
    Last Post: 29th November 2007, 12:50
  5. VBA Object Overview
    By robertf in forum VBA
    Replies: 0
    Last Post: 16th August 2007, 10:18

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •