|
发表于 2012-10-16 19:43:59
|
显示全部楼层
本帖最后由 netegg 于 2012-10-18 14:20 编辑
[au3]#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiTreeView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
$Debug_TV = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $hItem[6], $hTreeView, $hSubItem[5]
Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)
GUICreate("TreeView Checked", 400, 300)
$hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)
GUISetState()
_GUICtrlTreeView_BeginUpdate($hTreeView)
For $x = 0 To UBound($hItem) - 1
$hItem[$x] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New Item", $x + 1), $hTreeView)
For $y = 0 To 4
$hSubItem[$y] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] New SubItem", $y + 1), $hItem[$x])
_TreeViewRemoveCheckbox($hTreeView, $hSubItem[$y])
Next
Next
_GUICtrlTreeView_EndUpdate($hTreeView)
; _TreeViewRemoveCheckbox($hTreeView, $hItem[$hRandomItem])
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
Func _TreeViewRemoveCheckbox($hWnd, $hItem)
$hItem = GUICtrlGetHandle($hItem)
Local $Struct = DllStructCreate($tagTVITEMEX)
DllStructSetData($Struct, 1, 0x8)
DllStructSetData($Struct, 2, $hItem)
DllStructSetData($Struct, 3, 0)
DllStructSetData($Struct, 4, 0xF000)
GUICtrlSendMsg($hWnd, 0x110D, 0, DllStructGetPtr($Struct))
EndFunc ;==>_TreeViewRemoveCheckbox
[/au3] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|