Click to See Complete Forum and Search --> : ComboBox Dropdown event


Nawed
March 30th, 2001, 11:51 PM
Hi folks!

I was creating a personalized browser for myself in VB, when i ran realized that I could not eliminate duplicate values in the dropdown list of the address bar of my browser that I am creating. For example, i go to www.yahoo.com, it is added in to dropdown list but if i type it again, it shows up twice! I just want to be able to show it once since it is the same value!

Any help is much appreciated : )

[n]Shaikh
|Buy low - hold - prosper|

shree
March 31st, 2001, 04:44 AM
Set the Combo1.text to the value you want to check. If it is already in the list, then the listindex will change to the index of that string in the list. Else, it will remain -1. You can use this to your purpose. An example follows:


Combo1.Text="www.yahoo.com"
if Combo1.ListIndex = -1 then
Combo1.Additem "www.yahoo.com"
End If

Nawed
April 6th, 2001, 08:35 PM
Many thanx Shree. The code worked with slight modifs.

[n]Shaikh
| http://nawedshaikh.com |