#include <GuiListView.au3>
$Gui = GUICreate("Gui",550,600)
$ListView = GUICtrlCreateListView("№|Фамилия|Имя|Отчество",10,10,500,500,-1)
_GUICtrlListView_SetColumnWidth($ListView , 0, 70)
_GUICtrlListView_SetColumnWidth($ListView , 1, 150)
_GUICtrlListView_SetColumnWidth($ListView , 2, 150)
_GUICtrlListView_SetColumnWidth($ListView , 3, 100)
_AddItem()
GUISetState()
_GUICtrlListView_RegisterSortCallBack($ListView)
While 1
$msg = GUIGetMsg()
If $msg = -3 Then Exit
Switch $msg
Case $ListView
_GUICtrlListView_SortItems($ListView, GUICtrlGetState($ListView))
EndSwitch
WEnd
_GUICtrlListView_UnRegisterSortCallBack($ListView)
GUIDelete()
Func _AddItem()
Dim $aFam[3] =[ "Иванов","Петров", "Сидоров"]
Dim $aName[3]=["Иван", "Петр", "Сидор"]
Dim $aOt[3] =["Иванович", "Петрович", "Сидорович"]
For $i = 0 to 2
_GUICtrlListView_AddItem($ListView, $i, $i,_GUICtrlListView_GetItemCount($ListView) + 9999)
_GUICtrlListView_AddSubItem($ListView,$i, $aFam[$i],1)
_GUICtrlListView_AddSubItem($ListView,$i, $aName[$i],2)
_GUICtrlListView_AddSubItem($ListView,$i, $aOt[$i],3)
Next
EndFunc