home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / devtools / files / lb202win.exe / LB202W.EXE / COMBOBOX.BAS < prev    next >
Encoding:
BASIC Source File  |  2000-12-06  |  1.2 KB  |  44 lines

  1.  
  2.     'COMBOBOX.BAS  - a short combobox demo
  3.  
  4.     WindowWidth = 360
  5.     WindowHeight = 270
  6.  
  7.     array$(0) = "This"
  8.     array$(1) = "is"
  9.     array$(2) = "a"
  10.     array$(3) = "test"
  11.     array$(4) = "of"
  12.     array$(5) = "the"
  13.     array$(6) = "emergency"
  14.     array$(7) = "broadcast"
  15.     array$(8) = "system"
  16.  
  17.     combobox #main.testcb, array$(), [selected], 26, 16, 136, 200
  18.     textbox #main.index, 182, 16, 136, 25
  19.     button #main, "Accept Selection", [accept], UL, 182, 51, 136, 25
  20.     statictext #main.instruct, "Hey", 182, 86, 136, 200
  21.  
  22.     open "untitled" for dialog as #main
  23.  
  24.     instruct$ = "Select an item in the combobox and watch the " + _
  25.         "number change, then change the number and hit Accept " + _
  26.         "Selection go the other way."
  27.  
  28.     print #main.instruct, instruct$
  29.  
  30.     'wait here for input event
  31.     wait
  32.  
  33. [selected]   'Perform action for the combobox named 'testcb'
  34.  
  35.     print #main.testcb, "selectionindex? xVar"
  36.     print #main.index, str$(xVar)
  37.     wait
  38.  
  39. [accept]   'Perform action for the button named 'accept'
  40.  
  41.     print #main.index, "!contents? yVar"
  42.     print #main.testcb, "selectindex "; yVar
  43.     wait
  44.