Jump to content

GUICtrlCreateTreeView scrollbars


regi
 Share

Recommended Posts

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

Link to comment
Share on other sites

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