tedeski Posted September 17, 2018 Share Posted September 17, 2018 I need to search for TUniTreeMenu items, in TUniTreeView I use the following function ... already in TUniTreeMenu does not work var S, SString : string; I : Integer; aExpand : Boolean; begin SString := Trim(AText); if SString<>PSString then begin PSString := LowerCase(SString); if (Length(PSString) > 1) or (PSString = '') then begin aExpand := PSString<>''; tvmMenu.BeginUpdate; try tvmMenu.ResetData; for I := 0 to tvmMenu.Items.Count - 1 do begin S := LowerCase(tvmMenu.Items[I].Text); tvmMenu.Items[I].Visible := (Length(PSString) = 0) or (Pos(PSString, S)>0); tvmMenu.Items[I].Expanded := aExpand; end; finally tvmMenu.EndUpdate; end; end; end; end; Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted September 18, 2018 Share Posted September 18, 2018 Its not work like a treeview. "for I := 0 to tvmMenu.Items.Count - 1 do" This code not accsess to sub items. Counts NOT all items count, just Item's count. for I := 0 to tvmMenu.Items.Count - 1 do TMP_item:= tvmMenu.Items[I]; for J:=0 to TMP_item.items.Count -1 do Mean need write callback funtion, for chek all items. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.