CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2001
    Location
    Toronto, CANADA
    Posts
    16

    ComboBox Dropdown event

    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|

  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: ComboBox Dropdown event

    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





  3. #3
    Join Date
    Mar 2001
    Location
    Toronto, CANADA
    Posts
    16

    Re: ComboBox Dropdown event

    Many thanx Shree. The code worked with slight modifs.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured