Sign in to follow this  
Followers 0
devilyn

deselect tree-view item

1 post in this topic

I wrote this test script bellow to try to find a way to deselect a tree-view item

But for some reason _GUICtrlTreeView_GetSelection still returns an item selected.

#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>
#include <GuiTreeView.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 192, 124)
$List1 = GUICtrlCreateTreeView("", 10, 500, 225, 149)
GUICtrlCreateTreeViewItem("one",$List1)
GUICtrlCreateTreeViewItem("two",$List1)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

HotKeySet("a","test")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


Func test()
    _GUICtrlTreeView_SetSelected($List1,_GUICtrlTreeView_GetSelection($List1), False)
    ConsoleWrite(_GUICtrlTreeView_GetSelection($List1)&@CRLF)
EndFunc

Thanks in advance

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0