behdadsoft Posted April 19, 2015 Share Posted April 19, 2015 Hi. I created a treeView with some Items and child. and I want add some action for each child but I don't know how can check child is selected. Please Guide Me. Thanks. Link to comment Share on other sites More sharing options...
TheDcoder Posted April 19, 2015 Share Posted April 19, 2015 Please check this post TD EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
behdadsoft Posted April 19, 2015 Author Share Posted April 19, 2015 (edited) I checked it but don't work "GUICtrlRead() and GUICtrlGetState()" for check TreeViewChild. i wrote an example code, please see and tell me how to check child is selected or no. $GetFolderList = _FileListToArray() for $a = 1 to UBound($GetFolderList)-1 $AddTreeItem = _GUICtrlTreeView_Add() $RecordChildFolder = _FileListToArrayRec() ;Add Child to Item for $b = 1 to UBound($RecordChildFolder)-1 $AddTreeChild = _GUICtrlTreeView_AddChild() Next Next Thanks Edited April 19, 2015 by behdadsoft Link to comment Share on other sites More sharing options...
Kinshima Posted April 19, 2015 Share Posted April 19, 2015 Have you looked into _GUICtrlTreeView_GetState ( $hWnd [, $hItem = 0] ) ? https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlTreeView_GetState.htm Link to comment Share on other sites More sharing options...
behdadsoft Posted April 19, 2015 Author Share Posted April 19, 2015 (edited) This is my code I tested all things but can't do it. expandcollapse popup#RequireAdmin #include <File.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <StaticConstants.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <GuiButton.au3> #include <IE.au3> ;variables Global $RecordChildFolder = 0 Global $RecordFiles = 0 Global $GetFolderList = 0 Global $GUI = 0 Global $TreeObject = 0 Global $AddTreeItem = 0 Global $AddTreeChild = 0 Global $aStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS) ;Create GUI Form $GUI = GUICreate("TreeView Add", 320, 400) ;Create TreeView $TreeObject = GUICtrlCreateTreeView(2, 2, 300, 428,$aStyle, $WS_EX_CLIENTEDGE) ;Get Folder name to Array $GetFolderList = _FileListToArray(@ScriptDir,"*",$FLTA_FOLDERS) ;Get SubFolders and Add Child to Tree View Item for $a = 1 to UBound($GetFolderList)-1 $AddTreeItem = GUICtrlCreateTreeViewItem($GetFolderList[$a],$TreeObject) $RecordChildFolder = _FileListToArrayRec($GetFolderList[$a],"*",$FLTAR_FOLDERS,$FLTAR_RECUR ,$FLTAR_SORT ,"" ) ;Add Child to Item for $b = 1 to UBound($RecordChildFolder)-1 $AddTreeChild = GUICtrlCreateTreeViewItem($RecordChildFolder[$b],$AddTreeItem) Next Next GUISetState(@SW_SHOW) ;Repeat Show GUI While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($GUI) Edited April 19, 2015 by behdadsoft Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2015 Moderators Share Posted April 19, 2015 behdadsoft,What you want to do is trivial, but I am concerned by the following lines in your code:Global $PatchBtn = 0 Global $CrackBtn = 0 Global $KeygenBtn = 0Would you care to explain why you have these rather suspiciously sounding controls in your script?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
behdadsoft Posted April 19, 2015 Author Share Posted April 19, 2015 (edited) What you want to do is trivial, but I am concerned by the following lines in your code: Global $PatchBtn = 0Global $CrackBtn = 0Global $KeygenBtn = 0 sorry, this variables are relate to old part of my script and I forgot remove them.I fix them at above code. Edited April 19, 2015 by behdadsoft Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2015 Moderators Share Posted April 19, 2015 behdadsoft,Of course you did.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
behdadsoft Posted April 19, 2015 Author Share Posted April 19, 2015 Melba23 there is any solution for my problem? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2015 Moderators Share Posted April 19, 2015 behdadsoft,I have already told you that the problem is trivial. I suggest you search the forum as I have already answered this same question several times.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
behdadsoft Posted April 20, 2015 Author Share Posted April 20, 2015 I have already told you that the problem is trivial. I suggest you search the forum as I have already answered this same question several times. yes this problem is trivial and I search in forum but can't find good example relate to my problem for Select TreeViewChild. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2015 Moderators Share Posted April 20, 2015 behdadsoft can't find good exampleHow about >this one?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
behdadsoft Posted April 20, 2015 Author Share Posted April 20, 2015 How about this one? yes, I seen.but can't understand it. if possible please show it in my code. Thanks. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 20, 2015 Moderators Share Posted April 20, 2015 (edited) behdadsoft,What do you not understand? If you are not used to Windows message handling, perhaps the GUIRegisterMsg tutorial in the Wiki would be a good read.M23 Edited April 20, 2015 by Melba23 Fixed link Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
behdadsoft Posted April 20, 2015 Author Share Posted April 20, 2015 OK, I read it and if there is any problem I ask. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now