Operate the two functions of the TreeView control (reposted + original)

xiaoxiao2021-03-06  58

/ ************************************************** ********* /// Function: Travers all items, find target item // uf_find_Item // Para: // 1. Handle: Project handle long // 2. a_data: Target Item String ///// 3. AI_TYPE: Find Type INT // Return: (None) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////> ****************************************************** /

Long L_Ret, L_FindtreeViewItem LTVI_FIND

// Nothing to find ib_find = false

IF isnull (a_data) THEN / / MESSAGEBOX (GA_APP.DWMESSAGETLE, "Please enter the query condition!", Stopsign!) Return -1END IF

// do while yield () // loop

Do while handle <> -1 and not ib_find this.getitem (handle, ltvi_find) if ai_type = 1 THEN / / is accurate to find if String (LTVI_FIND.DATA) = a_data the selectitem (handle) ib_find = true return handle End if else // is ambiguous lookup if POS (LTVI_FIND.LABEL, STRING (A_DATA))> 0 THEN SELECTITEM (HANDLE) IF MessageBox ('', "is looking for the next" ' & string (a_data) ' ", Question !, Yesno!, 2) = 2 THEN IB_FIND = True Return Handle End if end if end if // - Judging whether the item is subkey, if the recursive call, the processing return value acquire the target item handle --- // 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_findELSE RETURN -1END IF // ===================================== ue_deleteitems / / Remove all tree nodes // long al_handle // wuhai // 20040725 / / =============================== ======== long ll_chi_handle, ll_parent_handlelong ll_cll_chi_handle = this.FindItem (ChildTreeItem!, al_handle) if ll_chi_handle> 0 then this.event ue_deleteitems (ll_chi_handle) // recursive function end ifll_parent_handle = this.FindItem (ParentTreeItem!, al_handle ) if al_handle = -1 and ll_parent_handle = -1 and ll_chi_handle = -1 Ten Return this.deleteItem (al_Handle) IL_C this.Event UE_DELETEITETETETETETETETETETETETETETETETETETETETETEMS (LL_PARENT_HANDLE) // Recursive function

转载请注明原文地址:https://www.9cbs.com/read-112903.html

New Post(0)