Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a textbox which should only accepts charecters that are in collection string of
autocomplete like this


AutoCompleteStringCollection collection={abhi,jeet,pratap};

so when i type any charecter except a,j,p (because these r first char in string)
it will not type in textbox.

and if 'a' pressed then next chracter would we only 'b' because 'abhi' string have b after a
and it not accept any char then 'b'
Posted
Comments
Orcun Iyigun 21-Nov-13 5:22am    
Why would you want that? Why do you want to limit the user and how do you think it will effect the user-friendliness?
Abhijeet pratap singh 21-Nov-13 5:36am    
by this user cant enter any string except the collection string
and it will help to prevent the wrong entries
Abhijeet pratap singh 21-Nov-13 5:39am    
because i have enter some item which is in collection string
and now on another winform i have to accept only the items which is in collection string only
thats user cant create mistake to enter the items name

thanx for reply
murkalkiran 21-Nov-13 5:27am    
I am not getting what you want? u want just AutoComplete?
Abhijeet pratap singh 21-Nov-13 5:34am    
no i have already applied autocomplete
the next i want is if AutoCompleteStringCollection have three values which are
1- abhi
2- jeet
3- pratap

then when i press any charecter except (a , j , p) it will not accept because collection string have only (a , j ,p) as starting char.

and after this if i press 'a' then it only accepts b after a because abhi have b after a


thanx for revert

Well here is my suggestion links:
Three Autocomplete implementations compared[^]
Efficient auto-complete with a ternary search tree[^]
How to create an efficient auto-complete?[^]

I think pick the implementation which suits your need instead of blocking user's key press.

Good luck,
OI
 
Share this answer
 
i got it using editable combobox
 
Share this answer
 

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