Make a selected item in a ListView visibleTag(s): WinAPI/Registry


int li_index
listviewitem llvi_data
string ls_name
CONSTANT int LVM_FIRST = 4096
CONSTANT int LVM_ENSUREVISIBLE = LVM_FIRST  + 19

ls_name = "howto"

// search for "howto" item and select it
li_index = lv_1.FindItem(0,ls_name,FALSE,FALSE)
IF li_index > 0 THEN
   lv_1.GetItem(li_index, llvi_data)
   llvi_data.HasFocus = TRUE
   llvi_data.Selected = TRUE
   lv_1.SetItem(li_index,llvi_data)
END IF

Send(Handle(lv_1),LVM_ENSUREVISIBLE ,li_index,0)

blog comments powered by Disqus