home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / SEARCH / SEARCH.DOC next >
Encoding:
Text File  |  1992-03-28  |  961 b   |  20 lines

  1. Example of searching a list box quickly!
  2. ----------------------------------------
  3.  
  4.         A modified solution to the probem posed in the
  5. March/April issue of BASIC Pro concerning searching a
  6. list box with Visual Basic.  The author, Mitchell Waite,
  7. correctly states that "setting the ListIndex property in
  8. Visual Basic is the same as clicking on the list box.
  9. This will trigger another Click event in the list box.
  10. Since we would use the Click event handler to change the
  11. text in the text box, our application could end up in an
  12. endless loop."  However by doing a simple If..Then..EndIf
  13. statement at the beginning of both the Click event for
  14. the list box and the Change event for the text, this can
  15. be avoided.  In the If statements we check some indication
  16. of what the active control is.  If it is not the same as
  17. the control whose code we are performing, we simple exit
  18. the sub routine.  The SEARCH application demonstrates how
  19. to do this.
  20.