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. C / C++ / MFC
  3. Preventing the movement of caret or focus

Preventing the movement of caret or focus

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

    HI..Need Help! I created a edit box subclassed by CWnd, not by CEdit. I did this for custom UI handling. It works well.. But I need the control not to lose the focus anytime.. Even another button contol clicked.. I tried to remove the code in CCmdTarget but it doesn't work well...How can I do this? Any Suggestion appreciated.. Regards..Bajy

    A 1 Reply Last reply
    0
    • R Ryan Park

      HI..Need Help! I created a edit box subclassed by CWnd, not by CEdit. I did this for custom UI handling. It works well.. But I need the control not to lose the focus anytime.. Even another button contol clicked.. I tried to remove the code in CCmdTarget but it doesn't work well...How can I do this? Any Suggestion appreciated.. Regards..Bajy

      A Offline
      A Offline
      Andrei Zenkovitch
      wrote on last edited by
      #2

      Hello! Include a handler for WM_KILLFOCUS message in your CWnd derived class that you use for subclassing edit box. in this handler you have to call SetFocus function to gain focus back to the control. Alternatively you can handle EN_KILLFOCUS notification in the edit box' parent window. In the handler for the notification you have to do the same - set focus back to the edit box using SetFocus() function. Regards, Andrei Zenkovitch Dundas Software

      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