Jump to content
Sign in to follow this  

Treeview embedded in a listview

Recommended Posts

I am trying to create a form where on the left column there is treeview with various information items.

There are two additonal columns which contain some more information about which item on the left.

What I came up with until now is the following :


#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=D:\winnut\winnut\tree.kxf

$Form1 = GUICreate("AForm1", 413, 305, 192, 117)

$TreeView1 = GUICtrlCreateTreeView(8, 28, 185, 262)

$TreeView1_0 = GUICtrlCreateTreeViewItem("Read Only Variables", $TreeView1)

$TreeView1_1 = GUICtrlCreateTreeViewItem("ups", $TreeView1_0)

$TreeView1_2 = GUICtrlCreateTreeViewItem("test", $TreeView1_1)

$TreeView1_3 = GUICtrlCreateTreeViewItem("Read/Write Variables", $TreeView1)

$TreeView1_4 = GUICtrlCreateTreeViewItem("ups", $TreeView1_3)

$TreeView1_5 = GUICtrlCreateTreeViewItem("test", $TreeView1_4)

$TreeView1_6 = GUICtrlCreateTreeViewItem("interval", $TreeView1_5)

$ListView1 = GUICtrlCreateListView("Value | Description", 193, 8, 209, 281)

$ListView1_0 = GUICtrlCreateListViewItem("Value1 | Desc1", $ListView1)

$ListView1_1 = GUICtrlCreateListViewItem("Value2 | Desc2", $ListView1)

$ListView1_2 = GUICtrlCreateListViewItem("Value2 | Desc2", $ListView1)

$ListView1_3 = GUICtrlCreateListViewItem("Value3 | Desc3", $ListView1)

$ListView1_4 = GUICtrlCreateListViewItem("Value4 | Desc4", $ListView1)

$ListView1_5 = GUICtrlCreateListViewItem("Value5 | Desc5", $ListView1)

$ListView1_6 = GUICtrlCreateListViewItem("Value6 | Desc6", $ListView1)

$ListView1_7 = GUICtrlCreateListViewItem("Value7 | Desc7", $ListView1)

$ListView1_8 = GUICtrlCreateListViewItem("Value8 | Desc8", $ListView1)


#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg





This obviously is not good enough because it is hard to associate items on the left side with their respective properties in the two rightmost columns?

Is there anyway to make all 3 columns to be part of the same control?

Share this post

Link to post
Share on other sites

Thanks Valery for the reply.

I too was thinking about something similar.

The problem is that for my gui we are talking a much wider tree (up to 4 levels).

The other problem is only the leafs of that tree should be displayed in the listview.

My problem here is that the item on the left (the tree leaf) wouldn't be aligned with

its properties to the right and it would be hard for a user to associate the item he selected with its properties.

Your screenshot gave me a different idea though.

Maybe I should just highlight the appropriate item in the listview table when selecting the leaf in the tree.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...