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. CRichEditCtrl Problem

CRichEditCtrl Problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++com
4 Posts 2 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.
  • D Offline
    D Offline
    Dhiraj kumar Saini
    wrote on last edited by
    #1

    I am using a a derived class from CRichEditCtrl which I got from codeproject. My application is in mfc. I am displaying a url in the form of hyperlink in my RichEdit control. Now When I click the url in the RichEdit control i am able to open the same url in a web browser. My problems starts now as my cursor position is now at the place in the URL where i clicked as a result of which the new text does not apper in the RichEDit Control in a new line but at the place where i click. Suppose the url is http://www.live2support.com and i clicked at the url with cursor position at p of http an dsuppose the incoming new text for RichEdit control is hello the it is displayed as httphello://www.live2support.com Please help me. Thanks In Advance. Dhiraj

    D 1 Reply Last reply
    0
    • D Dhiraj kumar Saini

      I am using a a derived class from CRichEditCtrl which I got from codeproject. My application is in mfc. I am displaying a url in the form of hyperlink in my RichEdit control. Now When I click the url in the RichEdit control i am able to open the same url in a web browser. My problems starts now as my cursor position is now at the place in the URL where i clicked as a result of which the new text does not apper in the RichEDit Control in a new line but at the place where i click. Suppose the url is http://www.live2support.com and i clicked at the url with cursor position at p of http an dsuppose the incoming new text for RichEdit control is hello the it is displayed as httphello://www.live2support.com Please help me. Thanks In Advance. Dhiraj

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

      So change the insertion point before inserting new text.

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      D 1 Reply Last reply
      0
      • D David Crow

        So change the insertion point before inserting new text.

        "Love people and use things, not love things and use people." - Unknown

        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

        D Offline
        D Offline
        Dhiraj kumar Saini
        wrote on last edited by
        #3

        can u tell me how it can be done.

        D 1 Reply Last reply
        0
        • D Dhiraj kumar Saini

          can u tell me how it can be done.

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

          Use the SetSel() method.

          "Love people and use things, not love things and use people." - Unknown

          "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

          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