Using ZenForms in OAD

In this subforum specific Topics concerning ZEN Core, e.g workbenches, are discussed
Post Reply
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Using ZenForms in OAD

Post by user-6033 »

Hi,

I wonder whether you may have any example of using forms in OAD? Like wForm = ZenForm(), wForm.Load("Some Form.czform"), etc?
I have tried loading an example form "Zeiss Form 2" but the loading procedure does not seem to work for me. I would like to use forms as an alternative to large user input Zenwindows and easier change between a short user input and possibility of extended user input.

Best regards
Fredrik Olsson
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Hello Fredrik,

the following code is more kind of a snippet than a real example.

But I hope that it helps to get a first impression how to work with ZenForm.

Code: Select all

form1 = Zen.Application.GetFirstForm()
form2 = Zen.Application.GetLastForm()

fName1 = form1.Name
fName2 = form2.Name

form = Zen.Application.GetForm(1)
fName = form.FileName

for i in range(0,form.ItemsCount):
    item = form.GetItem(i)
    id = item.Id
    lab = item.LabelText
    val = item.Value

ids = form.GetAllIds()
for i in range(0,ids.Length):
    id = ids[i]

labs = form.GetAllLabelTexts()
for i in range(0,labs.Length):
    lab = labs[i]
user-6033
Posts: 89
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6033 »

Thank You! It helped me a lot!


Best regards

Fredrik
Post Reply