回复 1# nmgwddj
这样不行吗?#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 496, 389, 270, 202)
$ListView1 = GUICtrlCreateListView("col1|col2|col3", 16, 16, 466, 302)
$ListViewButton = GUICtrlCreateContextMenu($ListView1)
$ListBut_1 = GUICtrlCreateMenuItem("换图标", $ListViewButton)
$ListBut_2 = GUICtrlCreateMenuItem("Eixt", $ListViewButton)
$Button1 = GUICtrlCreateButton("Button1", 328, 336, 75, 25)
$Button2 = GUICtrlCreateButton("Exit", 408, 336, 75, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Local $ListViewItem[10]
For $i = 0 To 9
$ListViewItem[$i] = GUICtrlCreateListViewItem('1 - ' & $i & '|2 - ' & $i & '|3 - ' & $i, $ListView1)
GUICtrlSetImage(-1, @SystemDir & '\shell32.dll', -25)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $ListBut_2, $Button2
Exit
Case $ListBut_1
For $count = 0 To 9
$check = _GUICtrlListView_GetItemState($ListView1, $count, $LVIS_SELECTED)
If $check Then ExitLoop
Next
GUICtrlSetImage($ListViewItem[$count], @SystemDir & '\shell32.dll', -20)
EndSwitch
WEnd
|