top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How prevent duplicate values, if text present in textbox , when added with listbox ?

+2 votes
589 views

I have a text named as "ABC" in textbox, I want to add it to a listbox...
If listbox contains already "ABC"or "abc"or "Abc"" or any combination of the letter "abc" should not allowed it.....

I am using c# code not vb.net....

posted Oct 14, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Dont have complete detail i.e. the code which you tried but it should be something like

if (!lstBox.Items.Contains(<text>))
{
        lstBox.Items.Add(listItem);
}
answer Oct 20, 2014 by Salil Agrawal
...