请教下怎么将TreeView 控件下所有内容清空“已解决”
本帖最后由 nuoyan 于 2021-9-18 21:08 编辑#Include <File.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 312, 530, 192, 124)
$TreeView1 = GUICtrlCreateTreeView(64, 24, 193, 385, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$FileList = _FileListToArray(@SystemDir & "\", "*", 2)
For $y = 1 To $FileList
$generalitem1 = GUICtrlCreateTreeViewItem($FileList[$y],$TreeView1)
$generalitem2 = GUICtrlCreateTreeViewItem($FileList[$y],$generalitem1)
Next
$Button1 = GUICtrlCreateButton("清空数据", 104, 448, 107, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
请教下清空TreeView 控件 所有创建的项 要怎么写
chzj589 发表于 2021-9-18 08:20
老大,麻烦源码发下,谢谢!{:1_509:} nuoyan 发表于 2021-9-18 08:36
老大,麻烦源码发下,谢谢!
查看帮助文件学习。控件的使用要自学
_GUICtrlTreeView_Delete
删除(树视图)项目及其所有子项.
#include <GuiTreeView.au3>
_GUICtrlTreeView_Delete ( $hWnd [, $hItem = 0] )
#include <GuiTreeView.au3>
_GUICtrlTreeView_DeleteAll ( $hWnd ) 感激不尽。谢谢。。
页:
[1]