Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 14th, 2004, 02:09 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default using textbox keypress/text changed

Is there a way to use keypress/text changed where you use that event to access data then display the data within the textbox? For example, you use textchanged to retrieve data and look for "artichoke" and type 'a'. It finds all things that start with 'a' and puts the first returned result in the textbox (lets say the first was "apple"). However the event fires again (it searchs for the results using "apple"). So even if you had "artichoke" you won't see it.

I was thinking of highlighting the possible display after it and somehow not making that count as user inputed text. Any ideas?

Reply With Quote
  #2 (permalink)  
Old September 15th, 2004, 01:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

I'm not sure what you want, let me guess -are you trying to make something like an autocomplete list box or combobox like the font combo box in microsoft word.
Reply With Quote
  #3 (permalink)  
Old September 15th, 2004, 07:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Text changed works when the control loses focus. So if they typed an A, they would have to click out of that control for it to even work. Unless you try hosting a C# forms control in a web form.

If you are talking windows forms, yes it can be done. Though I've never done it, I've seen it done.

Brian
Reply With Quote
  #4 (permalink)  
Old September 15th, 2004, 08:18 AM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Correct, I was talking about a windows form using c#

Reply With Quote
  #5 (permalink)  
Old September 17th, 2004, 06:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Highlighting the added part is a good idea.

Like if 'a' is pressed and 'apple' is searched and put in the text box --highlight 'pple'. Now if lets say 't' is pressed the highlighted 'pple' gets replaced with 't' and 'at' is searched now.

You may also wannt to disable the search when backsapce and delete are pressed.

I had written a somewhat similar thing only that i had a combobox acting as the list of data.
Reply With Quote
  #6 (permalink)  
Old October 10th, 2004, 12:03 AM
Friend of Wrox
 
Join Date: Feb 2004
Location: Bangalore, Karnataka, India.
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For ComboBox autocomplete you can use the following link, it is good.

http://www.kbalertz.com/Feedback_319946.aspx



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying text in textbox Europom Excel VBA 4 March 31st, 2007 06:28 AM
Cannot update textbox.text John Leo ASP.NET 2.0 Basics 0 March 27th, 2007 08:45 AM
Remove value of dropdown list when textbox changed sn00pyg4rfi3ld Javascript How-To 1 January 20th, 2005 07:08 AM
Aligning Text of a textbox mahulda General .NET 0 July 27th, 2004 12:16 AM



All times are GMT -4. The time now is 08:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.