How to create dynamical elements in VSTA
Hi,
I am using a demo version of Zenon 7.1 Supervisor. In an application we need a dynamic number (depending on varying setups) of controls such as buttons, static text elements and textboxes.
I tried running some code like this, adapting to samples in these forums:
Public Sub Macro1()
Dim btn As zenOn.IElement
Dim pic As zenOn.IDynPicture
pic = Me.DynPictures.Item(0)
btn = pic.Elements.Create("btnDynamic", zenOn.tpElementTypes.tpDynButton)
With btn
' Configuration part
However, when debugging, the pic.Elements.Create statement always returns "Nothing", so I must be doing something wrong. pic is set to the active screen.
In the result the button(s) should appear on the screen.
Is there a way to solve this?
This is a migrated post! Originally posted on 05.09.2013 by user skobis. Please be aware that information can be outdated.