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 control how to get deleted text

edit control how to get deleted text

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

    hi, in an edit control if multiple characters are selected and user presses delete button how we can deleted text that is "selected text" in WM_KEYDOWN or OnKeyDown handler?? same thing with OnChar also for backspace!! Thanks and regards Harshal

    R T 2 Replies Last reply
    0
    • H harsha_1234

      hi, in an edit control if multiple characters are selected and user presses delete button how we can deleted text that is "selected text" in WM_KEYDOWN or OnKeyDown handler?? same thing with OnChar also for backspace!! Thanks and regards Harshal

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

      Call the CWnd::OnkeyDown() in the overrided Onkeydown() Rinu Raj

      H 1 Reply Last reply
      0
      • H harsha_1234

        hi, in an edit control if multiple characters are selected and user presses delete button how we can deleted text that is "selected text" in WM_KEYDOWN or OnKeyDown handler?? same thing with OnChar also for backspace!! Thanks and regards Harshal

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        use CEdit::ReplaceSel("")[^]


        TOXCCT >>> GEII power

        [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

        1 Reply Last reply
        0
        • R Rinu_Raj

          Call the CWnd::OnkeyDown() in the overrided Onkeydown() Rinu Raj

          H Offline
          H Offline
          harsha_1234
          wrote on last edited by
          #4

          hi rinu, thanks for replying. but what i want to do is something different suppose "abcd" is the selected text and the caret is positioned before 'a' and if someone presses delete whole text will delete so i want to retrieve that text before it gets deleted. means i want abcd to be stored in some buffer or CString variable thank's Harshal

          R 1 Reply Last reply
          0
          • H harsha_1234

            hi rinu, thanks for replying. but what i want to do is something different suppose "abcd" is the selected text and the caret is positioned before 'a' and if someone presses delete whole text will delete so i want to retrieve that text before it gets deleted. means i want abcd to be stored in some buffer or CString variable thank's Harshal

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

            You may check whether the DEL key is pressed in the OnKeydown() If it is pressed then store the edit box content in a string variable. After that call the CWnd::OnKeydown() Rinu Raj

            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