regi Posted January 22, 2010 Share Posted January 22, 2010 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).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? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2010 Share Posted January 22, 2010 If you have single flat list of items, why use TreeView instead of ListBox or ListView? 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 More sharing options...
regi Posted January 22, 2010 Author Share Posted January 22, 2010 Well spotted The screenshot is actually testing script, the live version has both single items and some with sub-items... hence the choice of tree-view. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2010 Share Posted January 22, 2010 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 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now