Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been looking for a way to have a textbox detect that it's text is being changed during runtime and then executing code, (with a delay). I'm basically want to making a dropdown box appear with name suggestions according to what the user writes in the textbox.

I havn't any code, as I'm just looking for this functionality, without witch, I won't bother doing the dropdown and database interactions.
For clarification:

When the user types in "a" all db-objects with a name starting with an "a" gets listed, but only if the user haven't typed another character for 1 second. (so when a character is typed it starts the method, with has a delay it counts through, if it's interrupted by another character it resets, all the while having the contents of the textbox as a variable to use when it gets to count down to zero and executes the dropbox functions).

That's the functionality I'm going for


Thanks for helping a noob!

-frank
Posted
Updated 15-Apr-12 19:18pm
v3
Comments
CodeHawkz 16-Apr-12 1:02am    
Please, specify whether it's a web application or a desktop application. The implementation differs largely based on that.
Frank R. Haugen 16-Apr-12 1:20am    
I always assume C# is desktop, didn't really think it was necessary to specify, but yes, point taken, and now I've added a "desktop" tag. happy? :D

1 solution

Hi,

You can use AutoComplete feature of the TextBox to perform this task. Refer to the following link:

http://idpkshr.wordpress.com/2012/03/31/autosuggest-textbox-from-database-column-in-windows-forms/[^]
 
Share this answer
 
Comments
Frank R. Haugen 16-Apr-12 1:08am    
Bloody hell that was simple :S

thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900