Click here to Skip to main content
14,767,511 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do I get the value from Textbox and store it in string, and then get all the values from Combobox.

Compare the string from the Textbox with each element from the Combobox.

If anyone matches then show that it was already been there?
Updated 9-Jun-14 23:04pm
Kim Togo 10-Jun-14 4:29am
Is this a question about WinForm, WPF, ASP.NET ?
Kornfeld Eliyahu Peter 10-Jun-14 4:38am
Is this a question?
Kim Togo 10-Jun-14 4:39am
Yes. See this char => ?
That is a question mark.
Member 10718181 10-Jun-14 5:36am
TrushnaK 10-Jun-14 4:38am
so where you have a problem... start coading.
no one here to write down code for you..

try to do something with yourself.If you have problem then come up again.
Prasad Avunoori 10-Jun-14 5:05am
This guy wants to add items from textbox to combobox and want to existence of item before adding
to combobox.

TextBox.Text is already of type string. You can use it directly as in
bool alreadyThere = ComboBox.Items.Contains(TextBox.Text);

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