home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 February / PCWorld_2006-02_cd.bin / software / vyzkuste / triky / triky.exe / autoit-v3-setup.exe / Examples / GUICtrlRead.au3 < prev    next >
Text File  |  2005-01-07  |  570b  |  20 lines

  1. #include <GUIConstants.au3>
  2.  
  3. GUICreate("My GUICtrlRead")  ; will create a dialog box that when displayed is centered
  4.  
  5. $n1=GUICtrlCreateList ("", 10,10,-1,100 )
  6.  
  7. GUICtrlSetData(-1,"item1|item2|item3", "item2")
  8.  
  9. $n2=GUICtrlCreateButton ("button",0,100)
  10. GUICtrlSetState(-1,$GUI_FOCUS)            ; the focus is on this button
  11.  
  12. GUISetState ()       ; will display an empty dialog box
  13. ; Run the GUI until the dialog is closed
  14. Do
  15.     $msg = GUIGetMsg()
  16.     if $msg = $n2 then
  17.         msgbox(0,"list=", GUICtrlRead($n1))    ; display the value
  18.     endif
  19. Until $msg = $GUI_EVENT_CLOSE 
  20.