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. How to get text from a text box control pertaining to cursor position

How to get text from a text box control pertaining to cursor position

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
2 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.
  • A Offline
    A Offline
    AmarjeetSinghMatharu
    wrote on last edited by
    #1

    Hello All, I am changing the cursor position for inserting,updating and deleting the text in a text box control. I am able to get the cursor position pertaining to the current cursor location though. Please suggest me the way to find the text pertaining to the cursor. Thanks and Regards. Amar.

    N 1 Reply Last reply
    0
    • A AmarjeetSinghMatharu

      Hello All, I am changing the cursor position for inserting,updating and deleting the text in a text box control. I am able to get the cursor position pertaining to the current cursor location though. Please suggest me the way to find the text pertaining to the cursor. Thanks and Regards. Amar.

      N Offline
      N Offline
      Nelek
      wrote on last edited by
      #2

      From VC++ Help: CEditView::GetSelectedText void GetSelectedText( CString& strResult ) const; Parameters strResult: A reference to the CString object that is to receive the selected text. Remarks Call GetSelectedText to copy the selected text into a CString object, up to the end of the selection or the character preceding the first carriage-return character in the selection. A tip... Try checking the help. Go to index view, write the name of the control and at the bottom of the help text usually is "CLASS MEMBERS" link. With all the possible things you can do by default with that control/class.

      Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

      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