Function Reference


_GUICtrlListView_SetColumnOrder

Sets the left-to-right order of columns

#include <GuiListView.au3>
_GUICtrlListView_SetColumnOrder ( $hWnd, $sOrder )

Parameters

$hWnd Control ID/Handle to the control
$sOrder Use Opt('GUIDataSeparatorChar', param) to set Separator Char, delimited column order, must be formated as follows:
    "2|0|3|1"

Return Value

None.

Remarks

Columns are 0-based.

Related

_GUICtrlListView_GetColumnOrder, _GUICtrlListView_SetColumnOrderArray

Example

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $a_Order, $idListview

    GUICreate("ListView Set Column Order", 400, 300)
    $idListview = GUICtrlCreateListView("Column 1|Column 2|Column 3|Column 4", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

    ; Set column order
    MsgBox($MB_SYSTEMMODAL, "Information", "Changing column order")
    _GUICtrlListView_SetColumnOrder($idListview, "3|2|0|1")

    ; Show column order
    $a_Order = _GUICtrlListView_GetColumnOrderArray($idListview)
    MsgBox($MB_SYSTEMMODAL, "Information", StringFormat("Column order: [%d, %d, %d, %d]", $a_Order[1], $a_Order[2], $a_Order[3], $a_Order[4]))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>Example