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. Go to end?

Go to end?

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

    I have a CListBox that get some text. I want to go to the last input so I can see what text its comming. How can I do that?

    J 1 Reply Last reply
    0
    • L Larsson

      I have a CListBox that get some text. I want to go to the last input so I can see what text its comming. How can I do that?

      J Offline
      J Offline
      Joan M
      wrote on last edited by
      #2

      Hello Larsson, You should get the number of items using GetCount(); and then use GetText(int A, CString &CS); Where A must be the index of the last item. Where CS must be a receiver CString. Hope this helps.

      L 1 Reply Last reply
      0
      • J Joan M

        Hello Larsson, You should get the number of items using GetCount(); and then use GetText(int A, CString &CS); Where A must be the index of the last item. Where CS must be a receiver CString. Hope this helps.

        L Offline
        L Offline
        Larsson
        wrote on last edited by
        #3

        I cant get this to work, can you please typ a exemple here so I can see. I hace try to use this, iGo = m_AddLogg.GetCount(); m_AddLogg.GetText(iGo, sText); But this dont make me go down in the list. Note that sText in this case is emty.

        P J 2 Replies Last reply
        0
        • L Larsson

          I cant get this to work, can you please typ a exemple here so I can see. I hace try to use this, iGo = m_AddLogg.GetCount(); m_AddLogg.GetText(iGo, sText); But this dont make me go down in the list. Note that sText in this case is emty.

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #4

          Larsson wrote:

          iGo = m_AddLogg.GetCount(); m_AddLogg.GetText(iGo, sText);

          Index is zero based, so you need to use following code,

          iGo = m_AddLogg.GetCount();
          m_AddLogg.GetText((iGo-1), sText);

          Prasad Notifier using ATL | Operator new[],delete[][^]

          1 Reply Last reply
          0
          • L Larsson

            I cant get this to work, can you please typ a exemple here so I can see. I hace try to use this, iGo = m_AddLogg.GetCount(); m_AddLogg.GetText(iGo, sText); But this dont make me go down in the list. Note that sText in this case is emty.

            J Offline
            J Offline
            Joan M
            wrote on last edited by
            #5

            Weekend, sorry, I hope that the answer from prasad_som has been useful. Good luck...

            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