Jump to content

do action after TreeViewChild is Selected


Recommended Posts

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 by behdadsoft
Link to comment
Share on other sites

This is my code I tested all things but can't do it.

#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 by behdadsoft
Link to comment
Share on other sites

  • Moderators

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 = 0
Would you care to explain why you have these rather suspiciously sounding controls in your script?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

behdadsoft,

Of course you did.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

  • Moderators

behdadsoft

 

can't find good example

How about >this one?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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 by Melba23
Fixed link

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...