forever Posted April 9, 2006 Posted April 9, 2006 Well i've made a treeview with TVS_CHECKBOXES. Works all great only one problem: i have an item, lets call it bla and 2 subitems blo&bli I want checkboxes for blo&bli but not for the parent item (bla).. How to "remove" the parent-checkbox ? (with tvs_checkboxes enabled every item gets a checkbox; ...)
Holger Posted April 9, 2006 Posted April 9, 2006 Try this (beta required): expandcollapse popup#include <GUIConstants.au3> ; Next ;#include <GUITreeView.au3> ; Or this Global Const $TVIF_STATE = 0x0008 Global Const $TVIS_STATEIMAGEMASK = 0xF000 Global Const $TV_FIRST = 0x1100 Global Const $TVM_SETITEM = $TV_FIRST + 13 GUICreate('Test') $tv = GUICtrlCreateTreeView(10, 10, 200, 200, BitOr($TVS_HASBUTTONS, $TVS_DISABLEDRAGDROP, $TVS_HASLINES, $TVS_HASLINES, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)) $tvitem1 = GUICtrlCreateTreeViewItem('Item1', $tv) $tvitem2 = GUICtrlCreateTreeViewItem('Item2', $tvitem1) $tvitem3 = GUICtrlCreateTreeViewItem('Item3', $tvitem1) GUICtrlSetState($tvitem1, $GUI_EXPAND) RemoveCheckbox($tv, $tvitem1) GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Exit Func RemoveCheckbox($nTV, $nID) Local $hItem = GUICtrlGetHandle($nID) If $hItem = 0 Then $hItem = $nID Local $stTVITEM = DllStructCreate('uint;uint;uint;uint;ptr;int;int;int;int;uint;int') DllStructSetData($stTVITEM, 1, $TVIF_STATE) DllStructSetData($stTVITEM, 2, $hItem) DllStructSetData($stTVITEM, 3, 0) DllStructSetData($stTVITEM, 4, $TVIS_STATEIMAGEMASK) GUICtrlSendMsg($nTV, $TVM_SETITEM, 0, DllStructGetPtr($stTVITEM)) EndFunc Greets Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
forever Posted April 9, 2006 Author Posted April 9, 2006 (edited) [never mind;edited] Thanks. works great. Edited April 9, 2006 by forever
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