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. Clistbox

Clistbox

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
5 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.
  • C Offline
    C Offline
    celllllllll
    wrote on last edited by
    #1

    Hi guys, I would appreciate if someone could tell me "How to add selected item from one listbox to another"? I have 2 list boxes. While I execute my application, I select some items from one and some from another. Now, if one data item is not in another, I want to add that item to the list box. Thanks in advance C++Prog

    H 1 Reply Last reply
    0
    • C celllllllll

      Hi guys, I would appreciate if someone could tell me "How to add selected item from one listbox to another"? I have 2 list boxes. While I execute my application, I select some items from one and some from another. Now, if one data item is not in another, I want to add that item to the list box. Thanks in advance C++Prog

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

      like this CString str; m_ListBox1.GetText(m_ListBox1.GetCurSel(),str); m_ListBox2.AddString(str);//or InsertString_**


      **_

      whitesky


      C 1 Reply Last reply
      0
      • H Hamid Taebi

        like this CString str; m_ListBox1.GetText(m_ListBox1.GetCurSel(),str); m_ListBox2.AddString(str);//or InsertString_**


        **_

        whitesky


        C Offline
        C Offline
        celllllllll
        wrote on last edited by
        #3

        Thanks for your great help..but I don't know it is giving me errors like: left of '.GetText' must have class/struct/union type Thanks again C++Prog

        D 1 Reply Last reply
        0
        • C celllllllll

          Thanks for your great help..but I don't know it is giving me errors like: left of '.GetText' must have class/struct/union type Thanks again C++Prog

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

          Preeti9 wrote:

          left of '.GetText' must have class/struct/union type

          Which is telling you that m_ListBox1 must be a CListBox object.


          "The largest fire starts but with the smallest spark." - David Crow

          C 1 Reply Last reply
          0
          • D David Crow

            Preeti9 wrote:

            left of '.GetText' must have class/struct/union type

            Which is telling you that m_ListBox1 must be a CListBox object.


            "The largest fire starts but with the smallest spark." - David Crow

            C Offline
            C Offline
            celllllllll
            wrote on last edited by
            #5

            Thanks I got it C++Prog

            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