list box

search name in list box from textbox.text

Page 1 of 1

2 Replies - 1528 Views - Last Post: 27 December 2009 - 06:53 AM Rate Topic: -----

#1 sanjay jindal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-December 09

list box

Post icon  Posted 27 December 2009 - 06:04 AM

search name in list box from textbox.text
Is This A Good Question/Topic? 0
  • +

Replies To: list box

#2 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: list box

Posted 27 December 2009 - 06:08 AM

You could use a ForEach loop to iterate through the items in the ListBox and compare them with the value from the TextBox. When it is found, break the loop and notify the user.
Was This Post Helpful? 0
  • +
  • -

#3 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: list box

Posted 27 December 2009 - 06:53 AM

FindString and FindStringExact will return the index of

dim x as integer = listbox1.findstringexact(Textbox1.Text,0)



You can then select that item by the index number
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1