home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / shareware / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlListSelItemRangeEx.au3 < prev    next >
Encoding:
Text File  |  2006-06-17  |  1.0 KB  |  33 lines

  1. #include <GUIConstants.au3>
  2. #include <GuiList.au3>
  3.  
  4. Opt('MustDeclareVars',1)
  5.  
  6. Dim $msg, $ret,$listbox,$button,$button2
  7.  
  8. GUICreate("ListBox Set Item RangeEx Demo",400,250,-1,-1)
  9.  
  10. $listbox = GUICtrlCreateList("",125,40,180,120,BitOR($LBS_SORT, $WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY,$LBS_MULTIPLESEL))
  11. GUICtrlSetData($listbox,"test1|more testing|even more testing|demo|test2|test3|test4|test5|test6|test7|test8|test9|test10")
  12. $button = GUICtrlCreateButton("Set Items 1 - 5",85,160,120,40)
  13. $button2 = GUICtrlCreateButton("UnSet Items 1 - 5",220,160,120,40)
  14.  
  15. GUISetState ()
  16. While 1
  17.     $msg = GUIGetMsg()
  18.     Select
  19.         Case $msg = $GUI_EVENT_CLOSE
  20.             ExitLoop
  21.         Case $msg = $button
  22.             $ret = _GUICtrlListSelItemRangeEx($listbox,1,5)
  23.             If($ret == $LB_ERR) Then
  24.                 MsgBox(16,"Error","Unknown error from _GUICtrlListSelItemRangeEx")
  25.             EndIf
  26.         Case $msg = $button2
  27.             $ret = _GUICtrlListSelItemRangeEx($listbox,5,1)
  28.             If($ret == $LB_ERR) Then
  29.                 MsgBox(16,"Error","Unknown error from _GUICtrlListSelItemRangeEx")
  30.             EndIf
  31.     EndSelect
  32. Wend
  33.