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. Edit Box

Edit Box

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

    I want to use it as a server display . Which will display many things like IP etc. and it will go on displaying data as it reaches server. How do I update my attached m_strEdit variable to show many things without deleting the previous received data at Edit box. Rahul

    R D 2 Replies Last reply
    0
    • 1 123 RahulS

      I want to use it as a server display . Which will display many things like IP etc. and it will go on displaying data as it reaches server. How do I update my attached m_strEdit variable to show many things without deleting the previous received data at Edit box. Rahul

      R Offline
      R Offline
      Rinu_Raj
      wrote on last edited by
      #2

      suppose your m_strEdit is an Edit control of type CString then for updating the same with new data CString NewData = "a" m_strEdit += NewData

      _ 1 Reply Last reply
      0
      • R Rinu_Raj

        suppose your m_strEdit is an Edit control of type CString then for updating the same with new data CString NewData = "a" m_strEdit += NewData

        _ Offline
        _ Offline
        _AnsHUMAN_
        wrote on last edited by
        #3

        You can assign a string type variable to it and then use it to set/reset the contents back. You can always take the text from the edit box, attach some more characters to it and then replace the text but that would be a length procedure...

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        R 1 Reply Last reply
        0
        • 1 123 RahulS

          I want to use it as a server display . Which will display many things like IP etc. and it will go on displaying data as it reaches server. How do I update my attached m_strEdit variable to show many things without deleting the previous received data at Edit box. Rahul

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

          Like:

          CString strText;
          m_edit.GetWindowText(strText);
          strText += "More data...";
          m_edit.SetWindowText(strText);

          Another option is to move the insertion point to the end using SetSel(), and then replace what's there (which is nothing) using ReplaceSel(). Try 'em both to see which you prefer.


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          1 Reply Last reply
          0
          • _ _AnsHUMAN_

            You can assign a string type variable to it and then use it to set/reset the contents back. You can always take the text from the edit box, attach some more characters to it and then replace the text but that would be a length procedure...

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

            R Offline
            R Offline
            Rinu_Raj
            wrote on last edited by
            #5

            thats what he needed i think

            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