do while ll_tvi_second<>-1
ll_tvi_third=tv_1.finditem(childtreeitem!,ll_tvi_second)
do while ll_tvi_third<>-1
tv_1.getitem(ll_tvi_third,xt_tvitem)
ls_regulation_id=string(xt_tvitem.label)
if ls_regulation_id=as_regulation_id then
tv_1.selectitem(ll_tvi_third)
get_handle=ll_tvi_third
exit
end if
IF THIS.GetItem(handle,ltvi_temp) = -1 THEN RETURN -1
//生成句柄
IF NOT ltvi_temp.expandedonce THEN
THIS.ExpandItem(handle)
THIS.CollapseItem(handle)
END IF
IF IsNull(a_data) THEN
MessageBox(ga_app.dwmessagetitle,"请输入查询条件 !",StopSign!)
RETURN -1
END IF
Do While Yield()
Loop
DO WHILE handle <> -1 AND NOT ib_find
THIS.GetItem(handle,ltvi_find)
IF ai_type = 1 THEN //是准确查找
IF ltvi_find.data = a_data THEN
SelectItem(handle)
ib_find = TRUE
RETURN handle
END IF
ELSE //是模糊查找
IF Pos(ltvi_find.label,String(a_data)) > 0 THEN
SelectItem(handle)
IF MessageBox(ga_app.dwmessagetitle,'是否查找下一项 "' +&
String(a_data) + ' "' ,Question!,YesNo!,2) = 2 THEN
ib_find = TRUE
RETURN handle
END IF
END IF
END IF
//---判断该项是否有子项,有则,递归调用,处理返回值取得目标项句柄---//
l_ret = THIS.uf_if_child(handle)
IF l_ret >0 THEN
l_find = THIS.uf_find_item(l_ret,a_data,ai_type)
END IF
handle = THIS.FindItem(NextTreeItem!,handle)
LOOP
IF ib_find THEN
RETURN l_find
ELSE
RETURN -1
END IF