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 / C++ / MFC
  4. how to add a text dynamically in combo box?

how to add a text dynamically in combo box?

Scheduled Pinned Locked Moved C / C++ / MFC
debuggingtutorialquestion
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.
  • V Offline
    V Offline
    vikramkarthik
    wrote on last edited by
    #1

    Hello everyone.. i tried with TRACE command other than that give me some ideas.. vikram

    S H D 3 Replies Last reply
    0
    • V vikramkarthik

      Hello everyone.. i tried with TRACE command other than that give me some ideas.. vikram

      S Offline
      S Offline
      sheshidar
      wrote on last edited by
      #2

      CComboBox m_cmbBox1; CString str;//u have to write ur text to this str m_cmbBox1.AddString(str);

      V 1 Reply Last reply
      0
      • V vikramkarthik

        Hello everyone.. i tried with TRACE command other than that give me some ideas.. vikram

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        You can use of InsertString(1,"String") or AddString("String").


        WhiteSky


        1 Reply Last reply
        0
        • S sheshidar

          CComboBox m_cmbBox1; CString str;//u have to write ur text to this str m_cmbBox1.AddString(str);

          V Offline
          V Offline
          vikramkarthik
          wrote on last edited by
          #4

          thank u so much.. i tried with this also. and another question if i type a string in edit box . it should b placed in that combo box..

          1 Reply Last reply
          0
          • V vikramkarthik

            Hello everyone.. i tried with TRACE command other than that give me some ideas.. vikram

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            vikramkarthik wrote:

            i tried with TRACE command...

            Why in the world would you think that TRACE() would be used for updating a combobox? Since you are using MFC, use ClassWizard (Ctrl+W) to assign a CComboBox member variable to the control. When you are ready to update the control, use CComboBox::AddString() or CComboBox::InsertString().


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            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