01.
List<
string
> str =
new
List<
string
>();
02.
private
void
Form1_Load(
object
sender, EventArgs e)
03.
{
04.
for
(
int
i = 0; i < 50; i++)
05.
{
06.
comboBox1.Items.Add(
"Test "
+ i);
07.
}
08.
}
09.
10.
private
void
comboBox1_TextChanged(
object
sender, EventArgs e)
11.
{
12.
for
(
int
i = 0; i < str.Count- 1; i++)
13.
{
14.
if
(comboBox1.Text == str[i])
15.
{
16.
17.
textBox1.Text += comboBox1.Text +
"Have In Array Index = "
+ i + Environment.NewLine;
18.
return
;
19.
}
20.
}
21.
22.
textBox1.Text +=
"Add Item "
+ comboBox1.Text +
" in Array"
+ Environment.NewLine;
23.
str.Add(comboBox1.Text);
24.
}