• Creator
    Topic
  • #4223
    hvi
    Participant

    Hi Advansys Support,

    I’m new in Formativ-Programming, but I programmed a lot in VB and VBA.
    I’ve created a form (with Form Designer) and on this form a created several checkboxes and two buttons. When I click on the Ok-button I want to check which checkboxes are set to True.
    In VisualBasic i’m used to do this with a For-Each-Next loop, like:
    For Each object on thisForm

    Next

    Is it possible to access the objects on a form (created with Form Designer) this way.

    Thanks,
    Hans

  • Author
    Replies
  • #7534
    Support 3
    Participant

    See below a sample code to iterate through the From controls:

       
      iTotalControls = MainDlg.ControlCount
      for x = 0 to iTotalControls - 1
        set oControl = MainDlg.controls(x)
        msgbox oControl.caption
        set oControl = nothing
      next
    

    However, you can also access a Form control using the following approach:

       
      msgbox MainDlg.checkbox1.caption
    

    See this response about the components documentation.

    Hope this helps.

    Regards,
    Advansys Support

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.