/ Forums / Advansys Formativ / Creating Solutions with Formativ / How can I retreive the selected ListBox item?

  • Creator
    Topic
  • #4311
    rdryan
    Participant

    I’m using a form with a ListBox componant. I’m able to get the selected index using:

    if FormName.ListBoxName.Selected(i) then
    msgBox inttostr(i)
    end if

    But I have not found a way to pull the text value string.

    Thanks,
    rdryan

  • Author
    Replies
  • #7781
    Support 1
    Participant

    Have you obtained the Documentation for Forms Designer and Components?

    The ItemIndex property of the ListBox is a convenient way of getting the selected index:

      MsgBox IntToStr(FormName.ListBoxName.ItemIndex)

    Here is a sample for getting the string data from the selected listbox item:

      dim I
      dim iValue
    
      I = FormName.ListBoxName.ItemIndex
      iValue = FormName.ListBoxName.Item.Strings(I)
      MsgBox iValue

    I hope this helps.

    Regards,
    Advansys Support

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