标签:style blog color sp div c log amp r
老外写的Listview移动函数,支持多个选择项同时移动,比较不错,在此备份(变量名稍有修改)。
LV_MoveRow(Is_MoveUp = true) { If Is_MoveUp not in 1,0 Return While tempStr:=LV_GetNext(tempStr) i := A_Index, i%i% := tempStr, tempStr:="" If (!i) || ((i1 < 2) && Is_MoveUp) || ((i%i% = LV_GetCount()) && !Is_MoveUp) Return col_Count := LV_GetCount("Col"), row_From := LV_GetNext(0, "Focused"), d := Is_MoveUp ? -1 : 1 Loop, %i% { r := Is_MoveUp ? A_Index : i - A_Index + 1, ro := i%r%, rn := ro + d Loop, %col_Count% LV_GetText(to, ro, A_Index), LV_GetText(tn, rn, A_Index), LV_Modify(rn, "Col" A_Index, to), LV_Modify(ro, "Col" A_Index, tn), LV_Modify(ro, "-select -focus"), LV_Modify(rn, "select vis") If (ro = row_From) LV_Modify(rn, "Focus") } }
标签:style blog color sp div c log amp r
原文地址:http://www.cnblogs.com/easysky/p/4006474.html