Jump to content
Sign in to follow this  
regi

GUICtrlCreateTreeView scrollbars

Recommended Posts

regi

Hi,

Having a bit of trouble with GUICtrlCreateTreeView and scroll bars...

It's a rather simple script that just lists a lot of items extracted from an SQLite db into a treeview, however, I'm at a loss as to how to achieve a vertical scroll without a horizontal scroll-bar (horizontal isn't necessary given that the full item entries are indicated via a tooltip as default).

Posted Image

I've played with styles but to no avail...

$TreeView1 = GUICtrlCreateTreeView(15, 128, 220, 329, $WS_VSCROLL)

or

$TreeView1 = GUICtrlCreateTreeView(15, 128, 220, 329, $TVS_NOSCROLL, $WS_VSCROLL)

Can anyone give a quick tip to achieve vertical only scroll-bars? Or am I looking for something that doesn't exist? :D

Share this post


Link to post
Share on other sites
PsaltyDS

If you have single flat list of items, why use TreeView instead of ListBox or ListView?

:D


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
regi

Well spotted :D

The screenshot is actually testing script, the live version has both single items and some with sub-items... hence the choice of tree-view.

Share this post


Link to post
Share on other sites
PsaltyDS

Well, all you had to do was combine $TVS_NOHSCROLL with the default style:

#include <GuiConstants.au3>
#include <TreeviewConstants.au3>

$hGUI = GUICreate("Test", 300, 300)
$idTV = GUICtrlCreateTreeView(20, 20, 260, 260, BitOR($GUI_SS_DEFAULT_TREEVIEW, $TVS_NOHSCROLL))
For $i = 0 To 15
    $idItem = GUICtrlCreateTreeViewItem("Item = " & $i & "; Long text planted here to force horizontal scroll.", $idTV)
    For $s = 0 To 1
        GUICtrlCreateTreeViewItem("SubItem = " & $i & "-" & $s & "; Event longer text has been planted here to force even more horizontal scroll.", $idItem)
    Next
    ControlTreeView($hGUI, "", $idTV, "Expand", "#" & $i)
Next
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

:D


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  

×