Function Reference

_GUICtrlListViewSetColumnOrder

Sets the left-to-right order of columns in a list-view control.

#Include <GuiListView.au3>
_GUICtrlListViewSetColumnOrder($h_listview, $s_order)

 

Parameters

$h_listbox control id/control hWnd
$s_order "|" delimited column order i.e. "2|0|3|1"

 

Return Value

Returns nonzero if successful, or zero otherwise.
If an error occurs, the return value is $LV_ERR.

 

Remarks

Columns are Zero-based

 

Related

_GUICtrlListViewGetColumnOrder

 

Example


#include <GuiConstants.au3>
#include <GuiListView.au3>

opt('MustDeclareVars', 1)

Dim $listview, $button, $msg, $i, $ret

GUICreate("ListView Set Column Order", 392, 254)
$listview = GUICtrlCreateListView("col1|col2|col3|col4", 100, 10, 200, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER))
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP)
$button = GUICtrlCreateButton("Set Order", 150, 120, 90, 30)
GUISetState()
While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $button
         $ret = _GUICtrlListViewSetColumnOrder($listview, "3|2|0|1")
   EndSelect
WEnd