advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
ListIndex Property Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 [form.]ctlname.ListIndex[ = index%]
 
 Usage Notes
   ■ You can use the List or Text properties to return the string for the
     currently selected item in a list. For example:
 
         ctlname.Text
         ctlname.List(ctlname.ListIndex)
 
     See: List Property  Text Property
 
   ■ Changing ListIndex selects a new item in the list; changing ListIndex
     also invokes a Click Event. See: Click Event
 
   ■ ListIndex returns -1 if:
     • No item is selected (all controls except directory list boxes)
     • The user enters a choice in a combo box instead of selecting an
       existing item in the list
 
   ■ ListIndex is set to -1 (no item selected) immediately after an
     ADDITEM or REMOVEITEM operation.
     See: ADDITEM Method  REMOVEITEM Method
 
   ■ Use ListIndex to track the selected entry within a control. For each
     different control, the initial value of the ListIndex property has a
     specific meaning:
 
     Control                Setting     Meaning
     ══════════════════     ═══════     ════════════════════════════════════
     Combo box              -1          No item selected
     Directory list box     -1          Index of the current path when the
                                        control is loaded at run time;
                            -2, -3,     Index of directories above the
                            and so on   currently expanded directory
     Drive list box         n           Index of the current drive when the
                                        control is created at run time
     File list box          -1          No item selected
     List box               -1          No item selected
     ───────────────────────────────────────────────────────────────────────
     See: Combo Box Control       Directory List Box Control
          Drive List Box Control  File List Box Control
          List Box Control