itljl 发表于 2008-6-29 01:19:48

哪位能翻译一下_GUICtrlListView_SimpleSort 谢谢

可以对list view进行排序的函数,但没有翻译,哪位朋友能帮忙翻译一下。

_GUICtrlListView_SimpleSort
--------------------------------------------------------------------------------

Sorts a list-view control (limited)


#Include <GuiListView.au3>
_GUICtrlListView_SimpleSort($hWnd, ByRef $vDescending, $iCol)




参数

$hWnd Handle to the control
$vDescending Can be:
True - Sort Descending
False - Sort Ascending
Array - With the following format:
- First Column
- Second Column
- Last Column



返回值

None.



注意

This is a basic sort fuction, for advanced sort see GUICtrlRegisterListViewSort

itljl 发表于 2008-6-29 01:48:42

或者用这个示范一下。

#include <GUIConstants.au3>

GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES)
GUISetBkColor (0x00E0FFFF); will change background color

$listview = GUICtrlCreateListView ("col1|col2|col3",10,10,200,150);,$LVS_SORTDESCENDING)
$button = GUICtrlCreateButton ("Value?",75,170,70,20)
$item1=GUICtrlCreateListViewItem("item2|col22|col23",$listview)
$item2=GUICtrlCreateListViewItem("item1|col12|col13",$listview)
$item3=GUICtrlCreateListViewItem("item3|col32|col33",$listview)
$input1=GUICtrlCreateInput("",20,200, 150)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)   ; to allow drag and dropping
GUISetState()
GUICtrlSetData($item2,"ITEM1")
GUICtrlSetData($item3,"||COL33")
GUICtrlDelete($item1)

Do
$msg = GUIGetMsg ()
       
   Select
      Case $msg = $button
         MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2)
       Case $msg = $listview
         MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2)
   EndSelect
Until $msg = $GUI_EVENT_CLOSE

sanhen 发表于 2008-6-29 02:14:25

这不是窗体列表的“点击排序”吗?会用就行,用不着咬文嚼字的。

itljl 发表于 2008-6-29 22:16:19

是窗体列表的“点击排序“,但不会用。。。

sanhen 发表于 2008-6-30 04:32:58

汗。。。帮助明明有例子,不会用?出错还是什么原因?

itljl 发表于 2008-6-30 23:25:53

是出错,因为帮助里的变量经过了多次获取,弄得我头晕了。
如果您能帮忙告诉我。$hWnd, ByRef $vDescending, $iCol
这三个变量分别代表什么什么,就可以了,谢谢

ken0137 发表于 2008-8-19 00:10:04

j加三句话
列表排序的方法

Dim $B_DESCENDING
GUICtrlSetOnEvent($ListView3_1_1,"compositor")
Func compositor()
GUICtrlListView_SimpleSort ($ListView3_1_1, $B_DESCENDING, GUICtrlGetState($ListView3_1_1))
EndFunc

autoit3CN 发表于 2009-5-19 03:48:04

_GUICtrlListView_SimpleSort
排序列表视图控件(有功能限制)
_GUICtrlListView_SimpleSort ( $ hWnd , ByRef $ vDescending , $ iCol )
参数:
$ hWnd句柄控制
$ vDescending可以是:
True-排序降序
True-排序递增
True-以下格式:
[ 0 ] -第一栏
[ 1 ] -第二栏
[ n ] -最后一栏

返回值
none .

注意
这是一个基本的排序功能,更强大的功能见GUICtrlRegisterListViewSort
页: [1]
查看完整版本: 哪位能翻译一下_GUICtrlListView_SimpleSort 谢谢