Fügt dem Control eine neue Spalte hinzu
#include <GuiListView.au3>
_GUICtrlListView_InsertColumn ( $hWnd, $iIndex, $sText [, $iWidth = 50 [, $iAlign = -1 [, $iImage = -1 [, $bOnRight = False]]]] )
$hWnd | Control-ID / Handle des Controls |
$iIndex | 0-basierender Index der neuen Spalte |
$sText | Spaltenüberschrift |
$iWidth | [optional] Breite der Spalte in Pixel |
$iAlign | [optional] Ausrichtung des Spaltenkopfes und des Textes der Subitems in der Spalte: 0 - Text ist linksbündig 1 - Text ist rechtsbündig 2 - Text ist zentriert |
$iImage | [optional] 0-basierender Index eines Bildes innerhalb der Imagelist |
$bOnRight | [optional] Falls True erscheint das Bild rechts neben dem Text |
Erfolg: | Der Index der neuen Spalte |
Fehler: | -1 |
Die Ausrichtung der ersten Spalte (ganz links) ist immer linksbündig
- - - - - - - - Erklärung der Controls - - - - - - - -
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
Example()
Func Example()
GUICreate("ListView: Spalte einfügen (v" & @AutoItVersion & ")", 400, 300)
Local $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
; Setzt das ANSI Format
;~ _GUICtrlListView_SetUnicodeFormat($idListview, False)
; Spalten einfügen
_GUICtrlListView_InsertColumn($idListview, 0, "Spalte 1", 100)
_GUICtrlListView_InsertColumn($idListview, 1, "Spalte 2", 100)
_GUICtrlListView_InsertColumn($idListview, 2, "Spalte 3", 100)
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example