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. Make MFC View "read only" while allowing viewing, scrolling etc.

Make MFC View "read only" while allowing viewing, scrolling etc.

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++databasearchitecturelearning
3 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.
  • L Offline
    L Offline
    lctrncs
    wrote on last edited by
    #1

    The MFC SDI program has a document/view architecture and a dialog based flat file database. At times, 1. the rich text in the view must be "read only" (preferably the user is unable to obtain focus in the view) 2. while the user makes changes to the database 3. and saves the changes to the document as a whole (which of course does not contain any changes to the rich text the user can read but not edit in the view). At other times, all parts of the document view and database are availble for edit and save. QUESTION: How does one prevent changes to the view while allowing full "read only" access (including scrolling) of the rich text in the view (preferably from OnInitialUpdate), and still allow editing and normal file save (savemodified and dosave) for the (changed) dialog-based database? NOTE: Using PretranslateMessage in the Doc file traps keyboard input for a partial resolution, however, it also disables the scroll bar so only one page of the view may be displayed. SUGGESTIONS? Thanks.

    "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash

    M 1 Reply Last reply
    0
    • L lctrncs

      The MFC SDI program has a document/view architecture and a dialog based flat file database. At times, 1. the rich text in the view must be "read only" (preferably the user is unable to obtain focus in the view) 2. while the user makes changes to the database 3. and saves the changes to the document as a whole (which of course does not contain any changes to the rich text the user can read but not edit in the view). At other times, all parts of the document view and database are availble for edit and save. QUESTION: How does one prevent changes to the view while allowing full "read only" access (including scrolling) of the rich text in the view (preferably from OnInitialUpdate), and still allow editing and normal file save (savemodified and dosave) for the (changed) dialog-based database? NOTE: Using PretranslateMessage in the Doc file traps keyboard input for a partial resolution, however, it also disables the scroll bar so only one page of the view may be displayed. SUGGESTIONS? Thanks.

      "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Have you tried EM_SETOPTIONS with ECO_READONLY flag (CRichEditCtrl::SetReadOnly(BOOL)) ? I can't remember if that still lets the user scroll...

      L 1 Reply Last reply
      0
      • M Mark Salsbery

        Have you tried EM_SETOPTIONS with ECO_READONLY flag (CRichEditCtrl::SetReadOnly(BOOL)) ? I can't remember if that still lets the user scroll...

        L Offline
        L Offline
        lctrncs
        wrote on last edited by
        #3

        Thank you! EM_SETOPTIONS with the ECO_READONLY flag set rings the bel when the user attempts to edit the view, and does allow scrolling. Thanks again! It appears you are the person who helped me before. Your assistance is very much appreciated!

        "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash

        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