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. C#
  4. How to Make textbox autocomplete?

How to Make textbox autocomplete?

Scheduled Pinned Locked Moved C#
tutorialquestion
5 Posts 4 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.
  • L Offline
    L Offline
    lamiaa_123
    wrote on last edited by
    #1

    How to Make textbox autocomplete?

    J R 2 Replies Last reply
    0
    • L lamiaa_123

      How to Make textbox autocomplete?

      J Offline
      J Offline
      Jimmanuel
      wrote on last edited by
      #2

      Set the TextBox's AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource Properties to appropriate values depending on what exact behavior you wish it to have. MSDN[^]

      :badger:

      L 1 Reply Last reply
      0
      • L lamiaa_123

        How to Make textbox autocomplete?

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        See this[^] article. /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • J Jimmanuel

          Set the TextBox's AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource Properties to appropriate values depending on what exact behavior you wish it to have. MSDN[^]

          :badger:

          L Offline
          L Offline
          linqabc
          wrote on last edited by
          #4

          i changed AutoCompleteMode ==>suggest Autocmpletesource ==>Customersourc In foreach (DataRow row in (SelectAccounts().Rows) { textBox1.AutoCompleteCustomSource.Add( row["Account_Name"].ToString()); } it worked successfuly and displayed names in table Account now i want to get id for accountname that user enter SelectAccounts() return table accounts{id,Account_Name}

          J 1 Reply Last reply
          0
          • L linqabc

            i changed AutoCompleteMode ==>suggest Autocmpletesource ==>Customersourc In foreach (DataRow row in (SelectAccounts().Rows) { textBox1.AutoCompleteCustomSource.Add( row["Account_Name"].ToString()); } it worked successfuly and displayed names in table Account now i want to get id for accountname that user enter SelectAccounts() return table accounts{id,Account_Name}

            J Offline
            J Offline
            Jimmanuel
            wrote on last edited by
            #5

            OK, so loop through the rows again until you find the one where the account name matches what they entered in the TextBox and then grab the ID from that row. If you want to get fancy about how you do it then you could probably do it using Linq but looping and searching will work just fine.

            :badger:

            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