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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Combobox items Clear problem

Combobox items Clear problem

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestionannouncement
3 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.
  • B Offline
    B Offline
    Bso_Cool
    wrote on last edited by
    #1

    I am populate a combobox when they type each letter, so as they type a each letter words that apply to each letter is populated in the combobox, but I am having a problem when I clears it while they are typing it starts back at the begining so instead of them typing "abc" it goes "cba". Does anyone know how to make it so it doesn't do that? Here is sample of my Code: Title = ComboBox1.Text FileOpen(1, "/Titles.txt", 1) ComboBox1.Update() ComboBox1.Items.Clear() Do While Not EOF(1) Input(1, Titles) If Title.ToUpper = Mid(Titles.ToUpper, 1, Titles.Length) Then ComboBox1.BeginUpdate() ComboBox1.Items.Add(Titles) ComboBox1.EndUpdate() A = True End If Loop FileClose(1)

    M T 2 Replies Last reply
    0
    • B Bso_Cool

      I am populate a combobox when they type each letter, so as they type a each letter words that apply to each letter is populated in the combobox, but I am having a problem when I clears it while they are typing it starts back at the begining so instead of them typing "abc" it goes "cba". Does anyone know how to make it so it doesn't do that? Here is sample of my Code: Title = ComboBox1.Text FileOpen(1, "/Titles.txt", 1) ComboBox1.Update() ComboBox1.Items.Clear() Do While Not EOF(1) Input(1, Titles) If Title.ToUpper = Mid(Titles.ToUpper, 1, Titles.Length) Then ComboBox1.BeginUpdate() ComboBox1.Items.Add(Titles) ComboBox1.EndUpdate() A = True End If Loop FileClose(1)

      M Offline
      M Offline
      MatrixCoder
      wrote on last edited by
      #2

      Sorry, but I'm not to sure what the problem is. But here's how you add text to the ComboBox, and then remove it (if that's what you need).

      'Add text
      ComboBox1.Items.Add(TextBox1.Text)

      'Remove text
      ComboBox1.Items.Clear()

      Hope this is what you needed.


      Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.

      1 Reply Last reply
      0
      • B Bso_Cool

        I am populate a combobox when they type each letter, so as they type a each letter words that apply to each letter is populated in the combobox, but I am having a problem when I clears it while they are typing it starts back at the begining so instead of them typing "abc" it goes "cba". Does anyone know how to make it so it doesn't do that? Here is sample of my Code: Title = ComboBox1.Text FileOpen(1, "/Titles.txt", 1) ComboBox1.Update() ComboBox1.Items.Clear() Do While Not EOF(1) Input(1, Titles) If Title.ToUpper = Mid(Titles.ToUpper, 1, Titles.Length) Then ComboBox1.BeginUpdate() ComboBox1.Items.Add(Titles) ComboBox1.EndUpdate() A = True End If Loop FileClose(1)

        T Offline
        T Offline
        The ANZAC
        wrote on last edited by
        #3

        Perhaps set the combobox to sort the list, i thinke the property is sorted = true. If that doesn't work, clear and repopulate the list from the original source.

        Posted by The ANZAC

        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