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

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3.  
  4. Opt ('MustDeclareVars', 1)
  5. Dim $listview, $Btn_GetTop, $Btn_Exit, $msg, $Status
  6. GUICreate("ListView Get Top Index", 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_GetTop = GUICtrlCreateButton("Get Top Index", 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_GetTop
  32.             GUICtrlSetData($Status, "Top Index: " & _GUICtrlListViewGetTopIndex($listview))
  33.     EndSelect
  34. WEnd
  35. Exit
  36.