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

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3.  
  4. Opt ('MustDeclareVars', 1)
  5. Dim $listview, $Btn_TestScroll, $Btn_Exit, $msg, $Status, $i
  6. GUICreate("ListView Scroll", 392, 322)
  7.  
  8. $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149)
  9. GUICtrlCreateListViewItem("line1|data1|more1", $listview)
  10. GUICtrlCreateListViewItem("line2|data2|more2", $listview)
  11. GUICtrlCreateListViewItem("line3|data3|more3", $listview)
  12. GUICtrlCreateListViewItem("line4|data4|more4", $listview)
  13. GUICtrlCreateListViewItem("line5|data5|more5", $listview)
  14. GUICtrlCreateListViewItem("line6|data6|more6", $listview)
  15. GUICtrlCreateListViewItem("line7|data7|more7", $listview)
  16. GUICtrlCreateListViewItem("line8|data8|more8", $listview)
  17. GUICtrlCreateListViewItem("line9|data9|more9", $listview)
  18. GUICtrlCreateListViewItem("line10|data10|more10", $listview)
  19. GUICtrlCreateListViewItem("line11|data11|more11", $listview)
  20. GUICtrlCreateListViewItem("line12|data12|more12", $listview)
  21. $Btn_TestScroll = GUICtrlCreateButton("Scroll Test", 150, 230, 90, 40)
  22. $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)
  23. $Status = GUICtrlCreateLabel("Remember items are zero-indexed", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  24.  
  25. GUISetState()
  26. While 1
  27.     $msg = GUIGetMsg()
  28.     Select
  29.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  30.             ExitLoop
  31.         Case $msg = $Btn_TestScroll
  32.             For $i = 10 To 50 Step 10
  33.                 _GUICtrlListViewScroll($listview,0,$i)
  34.                 Sleep( 500 )
  35.                 _GUICtrlListViewScroll($listview,0,$i - ($i * 2))
  36.                 Sleep( 500 )
  37.             Next
  38.     EndSelect
  39. WEnd
  40. Exit
  41.