Forum > Databases

[SOLVED] SQLite search edit background color

<< < (2/2)

Pe3s:
Thanks for your help and advice :)

dseligo:

--- Quote from: Zvoni on May 12, 2022, 03:02:39 pm ---
--- Quote from: dseligo on May 12, 2022, 02:28:15 pm ---Why, what's wrong with OnChange event? Wouldn't OnKeyUp react also to arrow keys and similar, causing unnecessary queries to the database?

--- End quote ---
Exactly because of that. You can filter "illegal" keys.
the OnChange-Event doesn't ship the Key being pressed.

--- End quote ---

But OnChange doesn't fire when you press arrow keys, Page up/down, ...
It only fires when 'Text' is changed.
I don't understand the advantage of OnKeyUp if one only wants to know when content changes.


--- Quote from: Zvoni on May 12, 2022, 03:02:39 pm ---Now imagine having a "Search-History" (stored in a List or whatever).
And now imagine pressing the Arrow-Down-Button to quickswitch to the searchphrase before your current one.....

--- End quote ---

He asked about TEdit. But you can still use OnKeyDown for 'Search-History',.

Zvoni:
Have you read my edit?
Entering ‚%‘ as the first character (and OnChange you can‘t filter out keystrokes) would result in loading the whole table (PacketRecord not withstanding)

dseligo:

--- Quote from: Zvoni on May 12, 2022, 10:29:19 pm ---Have you read my edit?
Entering ‚%‘ as the first character (and OnChange you can‘t filter out keystrokes) would result in loading the whole table (PacketRecord not withstanding)

--- End quote ---

Maybe he wants that. Or maybe he wants to search for actual '%' character in the table, and he will escape this characters in the text prior to running query.

He could also check text these characters and remove them prior to running query. Or he could use OnKeyUp for filtering, and OnChange for running query.

Navigation

[0] Message Index

[*] Previous page

Go to full version