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. Forcing cursur to stay in CEdit

Forcing cursur to stay in CEdit

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 3 Posters 1 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.
  • S Offline
    S Offline
    Shay Harel
    wrote on last edited by
    #1

    Hi, This is actually a second part to a previous option. Assuming I "caught" the VK_TAB in PreTranslateMessage function of my custom CEdit control and did what I want. Now, how do I force the cursor to stay at the end of the line inside my CEdit control. right now, after I am done processing the VK_TAB, the focus goes to the next control. I want to prevent that. I tried SetFocus and return w/o running the CEdit::PreTranslateMessage after my processing but that did not help. Thank.

    CPalliniC 1 Reply Last reply
    0
    • S Shay Harel

      Hi, This is actually a second part to a previous option. Assuming I "caught" the VK_TAB in PreTranslateMessage function of my custom CEdit control and did what I want. Now, how do I force the cursor to stay at the end of the line inside my CEdit control. right now, after I am done processing the VK_TAB, the focus goes to the next control. I want to prevent that. I tried SetFocus and return w/o running the CEdit::PreTranslateMessage after my processing but that did not help. Thank.

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      from MSDN Pretran

      CWnd::PreTranslateMessage
      virtual BOOL PreTranslateMessage( MSG* pMsg );
      Return Value
      Nonzero if the message was translated and should not be dispatched;
      0 if the message was not translated and should be dispatched.

      Hence you have simply make your PreTranslateMessage implemantation to return 0 when Tab is intercepted. :) -- modified at 13:26 Monday 8th January, 2007

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      T 1 Reply Last reply
      0
      • CPalliniC CPallini

        from MSDN Pretran

        CWnd::PreTranslateMessage
        virtual BOOL PreTranslateMessage( MSG* pMsg );
        Return Value
        Nonzero if the message was translated and should not be dispatched;
        0 if the message was not translated and should be dispatched.

        Hence you have simply make your PreTranslateMessage implemantation to return 0 when Tab is intercepted. :) -- modified at 13:26 Monday 8th January, 2007

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

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

        please don't use the <pre> tag to quote long sentences. this enforce the page to display the line till the end, requiering us to scroll then...


        Don't know where to start ?
        Refer the Forums Guidelines and ask a friend

        [VisualCalc 3.0][Flags Beginner's Guide]

        CPalliniC 1 Reply Last reply
        0
        • T toxcct

          please don't use the <pre> tag to quote long sentences. this enforce the page to display the line till the end, requiering us to scroll then...


          Don't know where to start ?
          Refer the Forums Guidelines and ask a friend

          [VisualCalc 3.0][Flags Beginner's Guide]

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          I've modified it. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          In testa che avete, signor di Ceprano?

          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