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