怎么判断listviewitem是否被双击?
双击左侧listview中的item,相应的item的值就会被传送到另一个listview里~~如何实现呢?
[ 本帖最后由 binbin003 于 2009-1-22 00:53 编辑 ] 是_GUICtrlListView_SortItems吗? OR _GUICtrlListView_ClickItem?
[ 本帖最后由 ceoguang 于 2009-1-22 00:10 编辑 ] 帮助里找了一下,居然找不到双击的,用GUICtrlCreateContextMenu吧 注册$wm_notify, 利用$nm_dblclk判断~
回复 4# pusofalse 的帖子
刚才在论坛里看到dblclk的判断了,不过找不到了~~能说详细点儿吗~~谢谢~
PS:时间不早了,早睡哈,呵呵
回复 5# binbin003 的帖子
#include <GuiListView.au3>Global const $nm_dblclk = -3
Global const $wm_Notify = 0x4e
$hGui = GuiCreate('ListView Test', 400, 600)
Local $lvsExStyle = BitOr($lvs_ex_fullrowselect, _
$lvs_ex_gridlines, _
$lvs_ex_doublebuffer)
Local $lvs1 = GuiCtrlCreateListView("List1|View|Test", 5, 5, 390, 260, $lvs_report, $lvsExStyle+0x200)
Local $lvs2 = GuiCtrlCreateListView("List2|View|Test", 5, 270, 390, 260, $lvs_report, $lvsExStyle+0x200)
For $d = 1 to 10
$var = "lvs item " & $d
$var &= "|" & $var & " - 1|" & $var & " - 2"
GuiCtrlCreateListViewItem($var, $lvs1)
Next
For $d = 0 to 2
_GuiCtrlListView_SetColumnWidth($lvs2, $d, 100)
Next
GuiRegisterMsg($wm_Notify, "_wmNotify")
GuiSetState()
Do
$msg = GuiGetMsg()
Until $msg = -3
Func _wmNotify($hWnd, $message, $wParam, $sParam)
Local $tNmhdr, $hWndFrom, $code
$tNmhdr = DLLStructCreate($tagNmhdr, $sParam)
$hWndFrom = DLLStructGetData($tNmhdr, "hWndFrom")
$code = DLLStructGetData($tNmhdr, "code")
If $code = $nm_dblclk then
If $hWndFrom = GuiCtrlGetHandle($lvs1) then
_GuiCtrlListView_CopyItems($lvs1, $lvs2, False)
ElseIf $hWndFrom = GuiCtrlGetHandle($lvs2) then
_GuiCtrlListView_DeleteItemsSelected($hWndFrom)
EndIf
EndIf
$tNmhdr = 0
EndFunc ;==>_wmNotify()
回复 6# pusofalse 的帖子
太感谢了~~呵呵~~~回复 3# ceoguang 的帖子
谢了~~:face (31): 收下:face (33): 我也收下~~:face (33):
页:
[1]