Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hello every one.
 
I need your help about a control in c# that autocomplete text from a database
do you give me any component and code.
 
Thanks in advance.
 
Leonardo Ayala R.
Posted 28-Jan-12 6:53am
Comments
SAKryukov at 28-Jan-12 12:55pm
   
What code? Please, ask a question first. What is "TextBox"? Do you think there is only one class with this name? No.
Please, fully-qualified name. Remove "Visual-Studio" and "VisualStudio" (!) tags, tag the type of application and UI library. Is it WPF, Forms, ASP.NET, what?
--SA
SAKryukov at 28-Jan-12 12:56pm
   

A suggestion to all experts:
 
We should stop attempting to answer any questions if OP does not properly specify type of application, UI library and other relevant detail which would exclude this kind of confusion. All type mentioned in the question should be written in fully-qualified form. We should request it and only answer when OP comply. Multiple failures to specify such detail became a curse of this forum.

 
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Since it is a desktop (Windows) Application, Try the AutoComplete properties in Windows TextBox.
 
There are three properties you might need to take care of:
TextBox.AutoCompleteCustomSource
TextBox.AutoCompleteSource
TextBox.AutoCompleteMode
 

The below MSDN links should help:
 
http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.autocompletemode.aspx[^]
 
http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.autocompletesource.aspx[^]
 
http://msdn.microsoft.com/en-us/library/system.windows.forms.textbox.autocompletecustomsource.aspx[^]
  Permalink  
v3
Comments
leocode7 at 28-Jan-12 12:11pm
   
Hello, thanks, but my aplication is not web. it is a desktop aplication, or stand alone. it is only in c# code. no aspx.
can you give me another resource?
SAKryukov at 28-Jan-12 12:55pm
   
You still did not explain what application.
--SA
Jyothikarthik_N at 28-Jan-12 12:30pm
   
I've updated as per your requirement, Mark as answer if it solves! :)
Er Anuj Kaushal at 30-Nov-12 12:44pm
   
Hello, I have the same query, so please help me out. its like the last remaining thing in my project. what i want is , if i press "A" alphabet in textbox or datagridview while inserting the data again and again. i want it should open a list of all the items of same suffix. like if i press "A" then all the items starting from "A" will be opened in the list and i dont hv to write multiple times. Can u please help me out. Thanks
SAKryukov at 28-Jan-12 12:57pm
   
Please see my comment above, in red color.
--SA
Jyothikarthik_N at 28-Jan-12 13:00pm
   
Sure...
leocode7 at 28-Jan-12 13:20pm
   
take it easy my friends. I understand your suggestion.
Thanks for the solution. this is exactly that I want :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Check this Autocomplete Menu[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

It is very simple to create an autocomplete textbox
 
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
AutoCompleteStringCollection DataCollection = (add your collection here );
textBox1.AutoCompleteCustomSource = DataCollection
 
For more about ...Auto compelete textbox
 
Vayne
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 PIEBALDconsult 150
3 BillWoodruff 148
4 Jochen Arndt 135
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 7 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100