国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

操作treeview 控件的兩個(gè)函數(shù)(轉(zhuǎn)貼+原創(chuàng))

2024-07-21 02:07:26
字體:
供稿:網(wǎng)友

/**********************************************************/
//function        : 遍歷所有的項(xiàng),查找目標(biāo)項(xiàng)
//uf_find_item
//para            :
//      1. handle : 項(xiàng)目句柄     long
//      2. a_data : 目標(biāo)項(xiàng)數(shù)據(jù) string
//      3. ai_type: 查找類型 int
//return          : (none)
//
//date        
//comment         :
//      ai_type = 1 是準(zhǔn)確查找
//      ai_type = 2 是模糊查找
/*********************************************************/

long l_ret,l_find
treeviewitem ltvi_find

//沒有找到
ib_find = false

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 //是準(zhǔn)確查找
  if string(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('','是否查找下一項(xiàng) "' +&
    string(a_data) + ' "' ,question!,yesno!,2) = 2 then
    ib_find = true
    return handle
   end if
  end if
 end if
  //---判斷該項(xiàng)是否有子項(xiàng),有則,遞歸調(diào)用,處理返回值取得目標(biāo)項(xiàng)句柄---//
 l_ret = this.finditem(childtreeitem!,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


//=====================================
////ue_deleteitems
//刪除所有樹形節(jié)點(diǎn)的函數(shù)
//long al_handle
//wuhai
//20040725
//======================================
long ll_chi_handle,ll_parent_handle
long ll_c
ll_chi_handle = this.finditem (childtreeitem! , al_handle )
if ll_chi_handle > 0 then 
 this.event ue_deleteitems(ll_chi_handle ) //遞歸函數(shù)

end if
ll_parent_handle = this.finditem (parenttreeitem!  , al_handle)
if al_handle =-1 and ll_parent_handle = -1 and ll_chi_handle= -1 then return
this.deleteitem(al_handle)
il_c ++
this.event ue_deleteitems(ll_parent_handle ) //遞歸函數(shù)
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 天等县| 江华| 大名县| 巴马| 阳谷县| 广平县| 洱源县| 林西县| 延庆县| 临湘市| 小金县| 遵化市| 通州市| 泰宁县| 闽清县| 民丰县| 于田县| 江阴市| 桃园市| 兴山县| 玉环县| 迭部县| 开化县| 安西县| 兴和县| 柞水县| 新余市| 奉节县| 麻江县| 积石山| 嘉善县| 海伦市| 余姚市| 江阴市| 加查县| 饶平县| 三河市| 苏尼特右旗| 花垣县| 全州县| 日喀则市|