home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / shareware / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlListViewSetColumnHeaderText.au3 < prev    next >
Encoding:
Text File  |  2006-08-01  |  1.7 KB  |  45 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3. #Include <GuiStatusBar.au3>
  4.  
  5. Opt('MustDeclareVars', 1)
  6. Local $listview, $Btn_Exit, $msg, $Status, $GUI
  7. Local $a_PartsRightEdge[2] = [175, -1]
  8. Local $a_PartsText[2] = ["", ""]
  9. $GUI = GUICreate("ListView Set Column Header Text", 392, 322)
  10.  
  11. $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149)
  12. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
  13. GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
  14. $Status = _GUICtrlStatusBarCreate ($GUI, $a_PartsRightEdge, $a_PartsText)
  15.  
  16. If (_GUICtrlListViewJustifyColumn ($listview, 1, 2)) Then
  17.     _GUICtrlStatusBarSetText ($Status, "Justify column: 2 Successful", 1)
  18. Else
  19.     _GUICtrlStatusBarSetText ($Status, "Failed to Justify column: 2", 1)
  20. EndIf
  21. GUICtrlCreateListViewItem("line1|data1|more1", $listview)
  22. GUICtrlCreateListViewItem("line2|data2|more2", $listview)
  23. GUICtrlCreateListViewItem("line3|data3|more3", $listview)
  24. GUICtrlCreateListViewItem("line4|data4|more4", $listview)
  25. GUICtrlCreateListViewItem("line5|data5|more5", $listview)
  26. _GUICtrlListViewSetColumnWidth ($listview, 0, 75)
  27. _GUICtrlListViewSetColumnWidth ($listview, 1, 75)
  28. _GUICtrlListViewSetColumnWidth ($listview, 2, 75)
  29. If _GUICtrlListViewSetColumnHeaderText($listview, 1, "new text") Then
  30.     _GUICtrlStatusBarSetText ($Status, "Set Header Text: Successful", 0)
  31. Else
  32.     _GUICtrlStatusBarSetText ($Status, "Failed to Set Header Text", 0)
  33. EndIf
  34. $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)
  35.  
  36. GUISetState()
  37. While 1
  38.    $msg = GUIGetMsg()
  39.    Select
  40.       Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  41.          ExitLoop
  42.    EndSelect
  43. WEnd
  44. Exit
  45.