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

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5. Dim $listview, $Btn_Exit, $msg, $Status
  6. GUICreate("ListView Justify Column", 392, 322)
  7.  
  8. $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149)
  9. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
  10. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
  11. $Status = GUICtrlCreateLabel("Remember columns are zero-indexed", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  12. If (_GUICtrlListViewJustifyColumn ($listview, 1, 2)) Then
  13.    GUICtrlSetData($Status, 'Justify column: 2 Successful')
  14. Else
  15.    GUICtrlSetData($Status, 'Failed to Justify column: 2')
  16. EndIf
  17. GUICtrlCreateListViewItem("line1|data1|more1", $listview)
  18. GUICtrlCreateListViewItem("line2|data2|more2", $listview)
  19. GUICtrlCreateListViewItem("line3|data3|more3", $listview)
  20. GUICtrlCreateListViewItem("line4|data4|more4", $listview)
  21. GUICtrlCreateListViewItem("line5|data5|more5", $listview)
  22. _GUICtrlListViewSetColumnWidth ($listview, 0, 75)
  23. _GUICtrlListViewSetColumnWidth ($listview, 1, 75)
  24. _GUICtrlListViewSetColumnWidth ($listview, 2, 75)
  25. $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)
  26.  
  27. GUISetState()
  28. While 1
  29.    $msg = GUIGetMsg()
  30.    Select
  31.       Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  32.          ExitLoop
  33.    EndSelect
  34. WEnd
  35. Exit
  36.