Jump to content

Treeview and vertical scrollbars


Clark
 Share

Recommended Posts

Hi all

I've developed this little app which the organisation has been using for a bit now. It looks like this:

Posted Image

Now the problem is that the folders should really appear as a heirarchical structure. I have found some code to do this on the forums which uses treeview with the checkbox parameter set. It seems to work really well, however...

There is always a however.

As you can see from the attached image, the number of folders (these are retrieved from a database) can and does vary over time. Also, the number of folders is always likely to be more than what can be shown at any one time in the listview that it currently has.

So my question is (you knew I would get to the question eventually): How on earth do I include a vertical scrollbar so that the treeview can be scrolled up and down? (I've searched but cannot find the answer.)

TIA

Clark

Link to comment
Share on other sites

Do you mean something like this:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
$Requ = GUICreate("Requirements", 515, 337, -1, -1, $WS_CAPTION + $WS_SYSMENU, -1)
$hTreeView = GUICtrlCreateTreeView(16, 35, 233, 200, BitOR( $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_CHECKBOXES))
GUICtrlCreateTreeViewItem("Head 1", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUICtrlCreateTreeViewItem("Head 2", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUICtrlCreateTreeViewItem("Head 3", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUICtrlCreateTreeViewItem("Head 4", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUICtrlCreateTreeViewItem("Head 5", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUICtrlCreateTreeViewItem("Head 6", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUICtrlCreateTreeViewItem("Head 7", $hTreeView)
GUICtrlCreateTreeViewItem("Sub 1", -1)
GUICtrlCreateTreeViewItem("Sub 2", -1)
GUICtrlCreateTreeViewItem("Sub 3", -1)
GUICtrlCreateTreeViewItem("Sub 4", -1)
GUICtrlCreateTreeViewItem("Sub 5", -1)
GUISetState(@SW_SHOW) ; will display an empty dialog box
    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
Edited by Guest
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...