Hallo,
Ich habe hier mal dieses Hilfebeispiel leicht abgeändert:
Spoiler anzeigen
#include <TreeViewConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiTreeView.au3>
#include <WindowsConstants.au3>
GUICreate("TreeView Edit Text", 400, 300)
$hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $TVS_EDITLABELS)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]Dim $hItem[6]
For $x = 0 To 5
$hItem[$x] = _GUICtrlTreeView_Add($hTreeView, 0, StringFormat("[%02d] New Item", $x + 1))
Next
GUIRegisterMsg(0x004E, "MY_WM_NOTIFY")
[/autoit] [autoit][/autoit] [autoit]; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func MY_WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
;~ #forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR
;~ ConsoleWrite($hWnd & @TAB & $iMsg & @TAB & $iwParam & @TAB & $ilParam & @TAB & $iIDFrom & @CRLF)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hTreeView
Switch $iCode
Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
_GUICtrlTreeView_EditText($hTreeView, _GUICtrlTreeView_GetSelection($hTreeView))
ConsoleWrite("Doppelklick" & @CRLF)
Return 1 ; nonzero to not allow the default processing
;~ Return 0 ; zero to allow the default processing
Case $TVN_BEGINLABELEDITA, $TVN_BEGINLABELEDITW
ConsoleWrite("Edit angefangen" & @CRLF)
;~ Return 1 ; nonzero to not allow the default processing
Return 0 ; zero to allow the default processing
Case $TVN_ENDLABELEDITA, $TVN_ENDLABELEDITW
ConsoleWrite("Edit beendet" & @CRLF)
;~ Return 1 ; nonzero to not allow the default processing
Return 0 ; zero to allow the default processing
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>MY_WM_NOTIFY
könnt ihr mir sagen, warum
1. Die Lables nur bei einem "einfachen" klick, wenn das Item schon markiert war, editiert werden,
2. Die Änderungen nicht übernommen werden?
Wäre für DescribeIt sehr praktisch - das spart ne Menge platz im GUI, wenn ich die InputBox rausnehme, die ich bisher verwendet hab.