I need to do incremental search in listbox without sort attribute and without edit box as filter
Original sort is required !
Is there way to do it ?
Incremental search in listbox without sort and edit box ? Topic is solved
Re: Incremental search in listbox without sort and edit box ?
Perhaps a combobox is better suited https://www.autohotkey.com/boards/viewtopic.php?f=6&t=15002
(I assume you mean you don't want to have an edit control where you type the "find")
(I assume you mean you don't want to have an edit control where you type the "find")
Re: Incremental search in listbox without sort and edit box ? Topic is solved
This might do it:
But it doesn't make sense for me.
Code: Select all
#NoEnv
List := "ABC|BBC|CBC|BAC|BCC|CAB|CBB|CAA"
Gui, Margin, 50, 50
Gui, Add, ListBox, w200 r10 vSearchBox, %List%
Gui, Show, , ListBox
OnMessage(0x0102, "WM_CHAR")
Return
GuiClose:
ExitApp
WM_CHAR(W, L, M, H) {
; LB_ERR = -1, LB_FINDSTRING = 0x018F, LB_SETCURSEL = 0x0186
Static PrevTick := A_TickCount
, Find := ""
If (A_GuiControl = "SearchBox" ) {
ThisTick := A_TickCount
If ((ThisTick - PrevTick) > 500)
Find := Chr(W)
Else
Find .= Chr(W)
PrevTick := ThisTick
ItemIndex := DllCall("SendMessage", "Ptr", H, "UInt", 0x018F, "Ptr", -1, "Ptr", &Find, "Ptr")
DllCall("SendMessage", "Ptr", H, "UInt", 0x0186, "Ptr", ItemIndex, "Ptr", 0)
Return 0
}
}
Who is online
Users browsing this forum: Rohwedder and 182 guests