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

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5.  
  6. Dim $listview, $button, $msg, $i, $ret, $s_item
  7.  
  8. GUICreate("ListView Set Item Count", 392, 254)
  9. $listview = GUICtrlCreateListView("col1|col2|col3|col4", 100, 10, 200, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER))
  10. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
  11. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
  12. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP)
  13. $button = GUICtrlCreateButton("Add Items", 150, 120, 90, 30)
  14. _GUICtrlListViewSetItemCount($listview, 20)
  15. GUISetState()
  16. While 1
  17.    $msg = GUIGetMsg()
  18.    Select
  19.       Case $msg = $GUI_EVENT_CLOSE
  20.          ExitLoop
  21.       Case $msg = $button
  22.             For $i = 0 To 19
  23.                 $s_item = $i & "|" & $i & "|" & $i & "|" & $i
  24.                 GUICtrlCreateListViewItem($s_item, $listview)
  25.             Next
  26.    EndSelect
  27. WEnd
  28.