Jump to content

deselect tree-view item


Recommended Posts

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...