回复 1# kk_lee69
根本不是翻译的问题,更不是两岸用语的问题,而是你的知识面太窄了。
在那个程序或语言里都会有这个“热项”或什么“热按纽”等等,英语表达就是:hot item,hot button
也许下面的由帮助代码,我修改了点,你用鼠标在上面移动或点击选中一个item,看看输出,你就明白了
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES), $hListView
GUICreate("ListView Set Hot Item", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
$hListView = GUICtrlGetHandle($hListView)
_GUICtrlListView_SetExtendedListViewStyle($hListView, $exStyles)
GUISetState()
; Add columns
_GUICtrlListView_AddColumn($hListView, "Column 1", 100)
_GUICtrlListView_AddColumn($hListView, "Column 2", 100)
_GUICtrlListView_AddColumn($hListView, "Column 3", 100)
; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1")
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1")
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1")
; Loop until user exits
Local $iHotItem, $iHotItemOri = 0, $iSelectItem, $iSelectItemOri = 0
Do
$iHotItem = _GUICtrlListView_GetHotItem($hListView)
$iSelectItem = _GUICtrlListView_GetItemSelected($hListView, 1)
If $iHotItem <> $iHotItemOri Or $iSelectItem <> $iSelectItemOri Then
ConsoleWrite("Hot Item: " & $iHotItem & " " & $iSelectItem & @CRLF)
$iHotItemOri = $iHotItem
$iSelectItemOri = $iSelectItem
EndIf
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
|