点击“机器名|日期|状态”可使现表格按列排序,但中文的话会出现乱码,而旧版本可以使用ANS编码,新版去掉了这个编码。那新版还有其它办法解决这个问题吗?
#include <GUIConstants.au3>;gui
#include <GuiListView.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("日志查看", 555, 392, 193, 125)
$listview1 = GUICtrlCreateListView("机器名|日期|状态", 16, 16, 521, 337)
GUICtrlSendMsg($listview1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES);表格边框
GUICtrlSendMsg($listview1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$item1 = GUICtrlCreateListViewItem("auto1|中文|123456", $listview1)
$item2 = GUICtrlCreateListViewItem("auto2|中文|123456", $listview1)
$item3 = GUICtrlCreateListViewItem("auto3|中文|123456", $listview1)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $listview1 Then;以下两行为行排序
Dim $B_DESCENDING[_GUICtrlListView_GetColumnCount ($listview1) ]
_GUICtrlListView_SimpleSort ($listview1, $B_DESCENDING, GUICtrlGetState($listview1))
EndIf
WEnd
|