本帖最后由 水木子 于 2010-4-12 12:36 编辑
嘿嘿!俺来个向上移的,留点问题给LZ吧!(向下移的自己做)#include <GUIListView.au3>
#include <WindowsConstants.au3>
GUICreate("ListView", 320, 300)
$ListView1 = GUICtrlCreateListView("编号|姓名|ID", 1, 1, 318, 230, -1, _
BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES, $LVS_EX_FULLROWSELECT, $LVS_REPORT))
$anniu1 = GUICtrlCreateButton("上移被选项目", 100, 250, 100, 30)
_GUICtrlListView_SetColumnWidth($ListView1, 0, 50)
_GUICtrlListView_SetColumnWidth($ListView1, 1, 100)
_GUICtrlListView_SetColumnWidth($ListView1, 2, 100)
GUISetState(@SW_SHOW)
GUICtrlCreateListViewItem('1|张三|65786315', $ListView1)
GUICtrlCreateListViewItem('2|李四|56454688', $ListView1)
GUICtrlCreateListViewItem('3|王五|86575765', $ListView1)
GUICtrlCreateListViewItem('4|孙六|87654832', $ListView1)
GUICtrlCreateListViewItem('5|赵七|96325478', $ListView1)
GUICtrlCreateListViewItem('6|成八|64651873', $ListView1)
GUICtrlCreateListViewItem('7|冯九|96437251', $ListView1)
GUICtrlCreateListViewItem('8|钱十|64976835', $ListView1)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case - 3
Exit
Case $anniu1
_Mobile()
EndSwitch
WEnd
Func _Mobile()
$hItem = Number(_GUICtrlListView_GetSelectedIndices($ListView1))
$sTexta = _GUICtrlListView_GetItemTextString($ListView1, Number($hItem - 1))
$sTextb = _GUICtrlListView_GetItemTextString($ListView1, Number($hItem))
_GUICtrlListView_SetItemText($ListView1, Number($hItem), $sTexta, -1)
_GUICtrlListView_SetItemText($ListView1, Number($hItem - 1), $sTextb, -1)
_GUICtrlListView_ClickItem($ListView1, Number($hItem - 1))
EndFunc ;==>_Mobile
|