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. avoiding focus to read only edit control

avoiding focus to read only edit control

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

    In a dialog, some edit controls become read only / normal at runtime based on some conditions. When the edit is read only, I want to avoid focus to control. When tab pressed I want to set focus to next editable control. On Mouse click, focus should be in previous control only. To do this what message should I handle? I have DDXed edit controls to customized CEdit derived class. Thanks

    -- "Programming is an art that fights back!"

    A _ 2 Replies Last reply
    0
    • R rp_suman

      In a dialog, some edit controls become read only / normal at runtime based on some conditions. When the edit is read only, I want to avoid focus to control. When tab pressed I want to set focus to next editable control. On Mouse click, focus should be in previous control only. To do this what message should I handle? I have DDXed edit controls to customized CEdit derived class. Thanks

      -- "Programming is an art that fights back!"

      A Offline
      A Offline
      Adam Roderick J
      wrote on last edited by
      #2

      In Style of CEdit, u have Tab Stop. please uncheck Tab stop. :)

      Величие Бога не может быть недооценена.

      1 Reply Last reply
      0
      • R rp_suman

        In a dialog, some edit controls become read only / normal at runtime based on some conditions. When the edit is read only, I want to avoid focus to control. When tab pressed I want to set focus to next editable control. On Mouse click, focus should be in previous control only. To do this what message should I handle? I have DDXed edit controls to customized CEdit derived class. Thanks

        -- "Programming is an art that fights back!"

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        You have to remove the WS_TABSTOP style at runtime. You could do this at the same time you're making the control read only. Use CWnd::ModifyStyle[^] like edit.ModifyStyle(WS_TABSTOP, 0);

        «_Superman_» I love work. It gives me something to do between weekends.

        A 1 Reply Last reply
        0
        • _ _Superman_

          You have to remove the WS_TABSTOP style at runtime. You could do this at the same time you're making the control read only. Use CWnd::ModifyStyle[^] like edit.ModifyStyle(WS_TABSTOP, 0);

          «_Superman_» I love work. It gives me something to do between weekends.

          A Offline
          A Offline
          Adam Roderick J
          wrote on last edited by
          #4

          It better to do tab stop at run time than doing statically. Initially we can set the tab stop to 0 using the resource, but runtime changing is more useful as superman suggested. Full 5 for the answer :)

          Величие Бога не может быть недооценена.

          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