检索当前列的左到右顺序,返回数据数组.
#Include <GuiListView.au3>
_GUICtrlListView_GetColumnOrderArray($hWnd)
$hWnd | 控件句柄 |
返回如下格式数组: | |
[0] - 数组元素数量 | |
[1] - 第一列的索引 | |
[2] - 第一列的索引 | |
[n] - 最后列的索引 |
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
$Debug_LV = False ; 检查传递给 ListView 函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $a_order[5] = [4, 3, 2, 0, 1], $hListView
GUICreate("(Internal) ListView Get Column Order Array", 400, 325)
$hListView = GUICtrlCreateListView("Column 1|Column 2|Column 3|Column 4", 2, 2, 394, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, $LVS_EX_HEADERDRAGDROP)
_GUICtrlListView_SetColumnWidth($hListView, 0, 100)
_GUICtrlListView_SetColumnWidth($hListView, 1, 100)
_GUICtrlListView_SetColumnWidth($hListView, 2, 100)
_GUICtrlListView_SetColumnWidth($hListView, 3, 100)
GUISetState()
_GUICtrlListView_SetColumnOrderArray($hListView, $a_order)
$a_order = _GUICtrlListView_GetColumnOrderArray($hListView)
MsgBox(4160, "信息", StringFormat("Column order: [%d, %d, %d, %d]", $a_order[1], $a_order[2], $a_order[3], $a_order[4]))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main