Sign in to follow this  
Followers 0
bab

Selecting SubItems in TreeView

2 posts in this topic

I am trying (stress trying) to create a server documentation app using treeview. So far the menu looks like:

+Servers

-filesrv01

-htmdoc1

-htmldoc2

-dhtmloc3

-filesrv02

-htmldoc1

-htmldoc2

-htmldoc3

-filesrv03

-htmldoc1

-htmldoc2

-htmldoc3

My question: How do I write the code to showing that I selected for example filesrv03, doc3 and show that doc in a window using explorer. Thanks for your help.

My code so far:

#include <GuiConstantsEx.au3>

#include <GuiTreeView.au3>

#include <GuiTab.au3>

#include <Array.au3>

Global $hGUI, $hTreeView, $hTemp, $docs, $idButton

Dim $srvlst

Local $aArray[5] = ["Backup", "Baseline", "ChangeControl", "ComplianceCheck", "Configuration"]; subitems, documents for each server

Local $j

$hGUI = GUICreate("Server Compliance Reports", 1696, 1000)

$hTreeView = _GUICtrlTreeView_Create($hGUI, 30, 30, 200, 880)

$hTemp = _GUICtrlTreeView_Add($hTreeView, 0, "Server Compliance Reports")

$hTemp = _GUICtrlTreeView_AddChild($hTreeView, $hTemp, "Servers")

$srvlst = IniReadSection("servers.ini", "Servers")

For $i = 1 To $srvlst[0][0] Step +1

$docs = _GUICtrlTreeView_AddChild($hTreeView, $hTemp, $srvlst[$i][1])

For $j = 0 to 5 - 1

_GUICtrlTreeView_AddChild($hTreeView, $docs, $aArray[$j])

Next

Next

$idButton = GUICtrlCreateButton("Close", 280, 120)

GUISetState()

While 1

Switch GUIGetMsg()

Case $GUI_EVENT_CLOSE

Exit

Case $idButton

Exit

EndSwitch

WEnd

Share this post


Link to post
Share on other sites



Here is a working example that registers WM_NOTIFY to detect an item being clicked in a TreeView and then displaying which item.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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