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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. RichEdit text always selected when page becomes Active

RichEdit text always selected when page becomes Active

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 1 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.
  • B Offline
    B Offline
    Bryan Anslow
    wrote on last edited by
    #1

    I have a Property Sheet that contains four instances of a Property Page - which has a RichEdit Control, PushButton (Save) and a checkbox. Problem is, whenever any Property Page Tab is displayed, all of the text in the Richedit Control is always selected. In the RichEdit control, I did not set NoHide. Nor do I call SetOptions() or HideSelection() within the code. (Actually, I tried calling HideSelection() but it had no effect). I also reset the selection by calling SetSel(0,1) at every possible place e.g. OnInitDialog(), OnSetActive(). So, is there a way to prevent the text in the control from always being Selected when the Page becomes Active? Thanks, Bryan.

    B 1 Reply Last reply
    0
    • B Bryan Anslow

      I have a Property Sheet that contains four instances of a Property Page - which has a RichEdit Control, PushButton (Save) and a checkbox. Problem is, whenever any Property Page Tab is displayed, all of the text in the Richedit Control is always selected. In the RichEdit control, I did not set NoHide. Nor do I call SetOptions() or HideSelection() within the code. (Actually, I tried calling HideSelection() but it had no effect). I also reset the selection by calling SetSel(0,1) at every possible place e.g. OnInitDialog(), OnSetActive(). So, is there a way to prevent the text in the control from always being Selected when the Page becomes Active? Thanks, Bryan.

      B Offline
      B Offline
      Bryan Anslow
      wrote on last edited by
      #2

      For anyone who has this problem. For some reason, when the Paint handler is entered, the RichEditControl is always set to select all of the text. By re-setting the selection on OnPaint it will cause the text to be de-selected when displayed. Bryan.

      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