|
-
Jul 21st, 2010, 04:32 AM
#1
Thread Starter
Hyperactive Member
Dropdown Combobox Predictive Text
Hi All
I have 2 questions.
Question 1:
I have a combobox and have 10 items in it (Name of countries).
I want to make the users life easy so that when they click inside the combobox and start writing then the text box will start predicting the rest of the text in the combo box. i.e. if i start writing "U" then the textbox will start predicting "UK" as "UK" is already a pre-populated item in the combobox.
Question 2:
How can i restrict the user from selecting only values within the pre-populated items of the combobox. Bearing in mind the combobox allows the user to write inside it (for the benefit of predictive text). But lets say there are values of UK, USA then I dont want the combobox to accept the value of "Ukraine" when the user clicks away from the combobox.
Any ideas?
Thanks
-
Jul 21st, 2010, 04:52 AM
#2
Re: Dropdown Combobox Predictive Text
Set the ComboBox.DropDownStyle=DropDownList.
This will force the user to select only item from list.
Please mark you thread resolved using the Thread Tools as shown
-
Jul 21st, 2010, 04:53 AM
#3
Thread Starter
Hyperactive Member
Re: Dropdown Combobox Predictive Text
 Originally Posted by danasegarane
Set the ComboBox.DropDownStyle=DropDownList.
This will force the user to select only item from list.
But this will stop the predictive text as i explained in Question 1
-
Jul 21st, 2010, 05:05 AM
#4
Re: Dropdown Combobox Predictive Text
Then Populate the values of the items in combo box . And use this collection to create the
AutoCompleteSource Property to Custom
Then set the AutoCompleteMode Property to Suggest , and set the AutoCompleteCustomSource as your collections.
For checking the items it currently checked, check the selected index property of the combox. If any thing is selected from items in the Combox, then it will be > -1 , where 0 is the first item.
MSDN Example for Auto Suggest
Please mark you thread resolved using the Thread Tools as shown
-
Jul 21st, 2010, 05:06 AM
#5
Thread Starter
Hyperactive Member
Re: Dropdown Combobox Predictive Text
 Originally Posted by danasegarane
Then Populate the values of the items in combo box . And use this collection to create the
AutoCompleteSource Property to Custom
Then set the AutoCompleteMode Property to Suggest , and set the AutoCompleteCustomSource as your collections.
For checking the items it currently checked, check the selected index property of the combox. If any thing is selected from items in the Combox, then it will be > -1 , where 0 is the first item.
MSDN Example for Auto Suggest
Many thanks
-
Jul 21st, 2010, 06:55 AM
#6
Addicted Member
Re: Dropdown Combobox Predictive Text
Another alternative you might want to consider would be a list box, rather than a combo box.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|