TreeView对象选择某节点下所有节点与子节点
//
//
//?函數:?of_deselectall
//
//?屬性:?public???
//
// 參數: long al_handle
//
//?返回:?integer
//
//?功能:
//?如果是子節點,選擇本級節點下的所有子節點~
//
//
//聲明
long??????????? ll_hdl[]
long??????????? ll_parent
long??????????? ll_handle
integer???????? li_cnt
boolean???????? lb_result
treeviewitem??? lt_tvi
string????????? label
li_cnt = 1
ll_hdl[1] = al_handle
if GetItem(ll_hdl[li_cnt], lt_tvi) = -1 then return -1
if not lt_tvi.children then
?return 1
end if?
do while li_cnt > 0
?? if GetItem(ll_hdl[li_cnt], lt_tvi) = -1 then return -1
?
?//代碼?
?//寫判斷
?
?if lt_tvi.children then
??li_cnt ++
??ll_hdl[li_cnt] = FindItem(ChildTreeItem!, ll_hdl[li_cnt - 1])
?else
??? ll_hdl[li_cnt] = FindItem(NextTreeItem!, ll_hdl[li_cnt])
?end if?
?
?do while ll_hdl[li_cnt] <= 0
??li_cnt --
??? if li_cnt = 0 then exit
??? ll_hdl[li_cnt] = FindItem(NextTreeItem!, ll_hdl[li_cnt])
??
??? if ll_hdl[li_cnt] = -1 then CONTINUE
??
??? lb_result = false
??? ll_handle = ll_hdl[li_cnt]
??? ll_parent = FindItem(ParentTreeItem!,ll_handle)
??? DO UNTIL ll_parent = FindItem(RootTreeItem!, 0)
???if al_handle = ll_parent then
????lb_result = true
???end if?
???ll_handle = ll_parent
???ll_parent = FindItem(ParentTreeItem!,ll_handle)
??loop??
??
??if lb_result = true then
???CONTINUE
??? else
???li_cnt = 0
???exit
??end if
?loop?
loop
return 0
轉載于:https://www.cnblogs.com/PBDragon/archive/2012/03/14/2395627.html
總結
以上是生活随笔為你收集整理的TreeView对象选择某节点下所有节点与子节点的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三子相连的游戏
- 下一篇: IIS+php无法上传图片(转载自htt