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. rich edit

rich edit

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

    hi all if you want to hear my problem briefly it's that i have created a rich edit box in my dialog and now i cant put text in it properly is there a function or i should do it by first taking its DC(device context) . lots of thanks you kind professional :rose::-O

    A D 2 Replies Last reply
    0
    • R ramtinbahal

      hi all if you want to hear my problem briefly it's that i have created a rich edit box in my dialog and now i cant put text in it properly is there a function or i should do it by first taking its DC(device context) . lots of thanks you kind professional :rose::-O

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      Add Vairable of CString type with ur rich edit Box by Class Wizard .. then assiagn ur trext to its CString variable. then use UpdateData(FALSE); i.e. m_strVariable = " My Text "; UpdateData(FALSE); i hope u will get it n it works thanx zahid

      1 Reply Last reply
      0
      • R ramtinbahal

        hi all if you want to hear my problem briefly it's that i have created a rich edit box in my dialog and now i cant put text in it properly is there a function or i should do it by first taking its DC(device context) . lots of thanks you kind professional :rose::-O

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

        ramtinbahal wrote: i have created a rich edit box in my dialog and now i cant put text in it properly is there a function Create a CRichEditCtrl member variable and then use SetWindowText().


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        M 1 Reply Last reply
        0
        • D David Crow

          ramtinbahal wrote: i have created a rich edit box in my dialog and now i cant put text in it properly is there a function Create a CRichEditCtrl member variable and then use SetWindowText().


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          M Offline
          M Offline
          mohsen nourian
          wrote on last edited by
          #4

          thanks for your simple response but now i'm trying to put text in a rich edit control while accessing the way i put it there . i mean how i can put text at a line number and a column i wish (example line 5 column 20 ) ? setwindowtext() is good for one line rich edit but i have a multiline rich edit box .so i need a way to write text in it how i wish . Strangely there is no function in rich edit class to do it (except SetWindowText() ) or maybe i dont know because i searched MSDN entirely but nothing found . lots of thanks

          D 1 Reply Last reply
          0
          • M mohsen nourian

            thanks for your simple response but now i'm trying to put text in a rich edit control while accessing the way i put it there . i mean how i can put text at a line number and a column i wish (example line 5 column 20 ) ? setwindowtext() is good for one line rich edit but i have a multiline rich edit box .so i need a way to write text in it how i wish . Strangely there is no function in rich edit class to do it (except SetWindowText() ) or maybe i dont know because i searched MSDN entirely but nothing found . lots of thanks

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

            SetWindowText() can be used, but you'll either need to call GetWindowText(), or have the text stored in a separate buffer. For example:

            CString strBuffer1;
            ...
            strBuffer1 = strBuffer1 + "\r\n" + ...
            m_edit.SetWindowText(strBuffer1);

            The other way would look like:

            CString strBuffer2;
            m_edit.GetWindowText(strBuffer1);
            strBuffer2 = strBuffer1 + "\r\n" + ...
            m_edit.SetWindowText(strBuffer2);

            You can also use ReplaceSel().


            "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

            M 2 Replies Last reply
            0
            • D David Crow

              SetWindowText() can be used, but you'll either need to call GetWindowText(), or have the text stored in a separate buffer. For example:

              CString strBuffer1;
              ...
              strBuffer1 = strBuffer1 + "\r\n" + ...
              m_edit.SetWindowText(strBuffer1);

              The other way would look like:

              CString strBuffer2;
              m_edit.GetWindowText(strBuffer1);
              strBuffer2 = strBuffer1 + "\r\n" + ...
              m_edit.SetWindowText(strBuffer2);

              You can also use ReplaceSel().


              "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

              M Offline
              M Offline
              mohsen nourian
              wrote on last edited by
              #6

              realy thank you david it did work . i was going to be realy disappoited with microsoft . but you saved them ;) good luck

              1 Reply Last reply
              0
              • D David Crow

                SetWindowText() can be used, but you'll either need to call GetWindowText(), or have the text stored in a separate buffer. For example:

                CString strBuffer1;
                ...
                strBuffer1 = strBuffer1 + "\r\n" + ...
                m_edit.SetWindowText(strBuffer1);

                The other way would look like:

                CString strBuffer2;
                m_edit.GetWindowText(strBuffer1);
                strBuffer2 = strBuffer1 + "\r\n" + ...
                m_edit.SetWindowText(strBuffer2);

                You can also use ReplaceSel().


                "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

                M Offline
                M Offline
                mohsen nourian
                wrote on last edited by
                #7

                realy thank you david it did work . i was going to be realy disappoited with microsoft . but you saved them ;) 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