Sign in to follow this  
Followers 0
scila1996

How to put event for treeview

2 posts in this topic

#include <GUIConstantsEx.au3>
#include <GuiTreeView.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>

Opt("GUIOnEventMode",1)

Local $hGUI = GUICreate("ControlTreeView Example", 212, 212)
Local $iTreeView_1 = GUICtrlCreateTreeView(6, 6, 200, 160, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_CHECKBOXES), $WS_EX_CLIENTEDGE)
Local $hTreeView_1 = ControlGetHandle($hGUI, "", $iTreeView_1)
Local $but = GUICtrlCreateButton("Click Me",120,175,70,30)
Local $iRoot = GUICtrlCreateTreeViewItem(" Select Drive", $iTreeView_1)
Local $dg = DriveGetDrive("FIXED")

For $itest = 1 To $dg[0]
    GUICtrlCreateTreeViewItem(StringUpper($dg[$itest]), $iRoot)
Next
    _GUICtrlTreeView_Expand($iTreeView_1)
    GUISetState(@SW_SHOW, $hGUI)

GUISetOnEvent(-3,"_clickexit")

Func _clickexit()
    Exit
EndFunc

While 1
    Sleep(10)
WEnd
I have created a list of tree drive 
 
But I know the event or set the variable if one or more of the selected drive 
I have 2 problems 
 
+ If I check the box "Select Drive" ---> automatic check on the drive 
 
+ Click Me When click will list the selected drive

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