Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MatchWithList in Combo Box?

MatchWithList in Combo Box?

Scheduled Pinned Locked Moved Visual Basic
helpquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Widgets
    wrote on last edited by
    #1

    Hi All, In VB6's, Combobox has MatchWithList... My problem is, i cant find the counterpart or equivalent of MatchWithList in VB 2005's Combo Box.. Does anybody knows where can i find it? Please help and thanks in advance.... Widgets....

    D 1 Reply Last reply
    0
    • W Widgets

      Hi All, In VB6's, Combobox has MatchWithList... My problem is, i cant find the counterpart or equivalent of MatchWithList in VB 2005's Combo Box.. Does anybody knows where can i find it? Please help and thanks in advance.... Widgets....

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You're looking for the AutoCompleteMode and AutoCompleteSource properties.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      W 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You're looking for the AutoCompleteMode and AutoCompleteSource properties.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        W Offline
        W Offline
        Widgets
        wrote on last edited by
        #3

        Thanks alot is working... Is there any property that will let me know if that AutoCompleteSource will nothing so suggest..? something like giving "true" if it suggested a string or "false" if it no suggested string?

        D 1 Reply Last reply
        0
        • W Widgets

          Thanks alot is working... Is there any property that will let me know if that AutoCompleteSource will nothing so suggest..? something like giving "true" if it suggested a string or "false" if it no suggested string?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Nope. You'd have to make your own version of the ComboBox to do that. Probably tracking how many characters the user actually typed against the length of the string in the Text property, maybe.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          S 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Nope. You'd have to make your own version of the ComboBox to do that. Probably tracking how many characters the user actually typed against the length of the string in the Text property, maybe.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            S Offline
            S Offline
            Suraj Babu
            wrote on last edited by
            #5

            ///Please use this function for MatchWithList
            public static bool MatchWithList(ref ComboBox cmb, string cmbText)
            {
            bool matchexists = false;

            int i = cmb.FindStringExact(cmbText);
            if (i != -1)
            {
                cmb.SelectedIndex = i;
                matchexists = true;
            }
            else
            {
                matchexists = false;
            }
            
            return matchexists;
            

            }

            D 1 Reply Last reply
            0
            • S Suraj Babu

              ///Please use this function for MatchWithList
              public static bool MatchWithList(ref ComboBox cmb, string cmbText)
              {
              bool matchexists = false;

              int i = cmb.FindStringExact(cmbText);
              if (i != -1)
              {
                  cmb.SelectedIndex = i;
                  matchexists = true;
              }
              else
              {
                  matchexists = false;
              }
              
              return matchexists;
              

              }

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Yeah....ok. :~ And why are you replying to a 4 year old message??

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups