Treeview Row Height

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Treeview Row Height

26 Apr 2014, 04:14

Following the example in the help file I've managed to create a treeview but is there anyway to make the height of each row taller? This is to make it easier for fat fingers using a touchscreen to select an item in the treeview. Thanks.
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Re: Treeview Row Height

27 Apr 2014, 05:35

Thanks, I followed the link but still can't understand how to use TVM_SETITEMHEIGHT. What would I need to do if, for example, I wanted to make each line 50 pixels high?
just me
Posts: 9456
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Treeview Row Height

27 Apr 2014, 05:49

You have to send the message to the TreeView control (SendMessage).

Modified sample from the help file:

Code: Select all

#NoEnv
TVM_SETITEMHEIGHT := 0x111B
ItemsHeight := 50 ; pixels
Gui, Add, TreeView, hwndHTV ; added hwnd option
P1 := TV_Add("First parent")
P1C1 := TV_Add("Parent 1's first child", P1)  ; Specify P1 to be this item's parent.
P2 := TV_Add("Second parent")
P2C1 := TV_Add("Parent 2's first child", P2)
P2C2 := TV_Add("Parent 2's second child", P2)
P2C2C1 := TV_Add("Child 2's first child", P2C2)
Gui, Add, Button, gChangeItemSHeight, Change Items Height ; added

Gui, Show  ; Show the window and its TreeView.
return

GuiClose:  ; Exit the script when the user closes the TreeView's GUI window.
ExitApp

ChangeItemsHeight:
SendMessage, %TVM_SETITEMHEIGHT%, %ItemsHeight%, 0, , ahk_id %HTV%
Return
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

[solved] Re: Treeview Row Height

27 Apr 2014, 07:59

I got it - thanks for the example, very useful.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Dobbythenerd1, Google [Bot] and 308 guests