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#
  4. Accepting Tab

Accepting Tab

Scheduled Pinned Locked Moved C#
com
8 Posts 4 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.
  • N Offline
    N Offline
    Nnamdi Onyeyiri
    wrote on last edited by
    #1

    I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.


    :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
    :suss:"All programmers are playwrights and all computers are lousy actors."

    N R B 3 Replies Last reply
    0
    • N Nnamdi Onyeyiri

      I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.


      :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
      :suss:"All programmers are playwrights and all computers are lousy actors."

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Have you just tried to reset the focus back to your control at that point? Nick Parker


      N 1 Reply Last reply
      0
      • N Nick Parker

        Have you just tried to reset the focus back to your control at that point? Nick Parker


        N Offline
        N Offline
        Nnamdi Onyeyiri
        wrote on last edited by
        #3

        yes, and it does not work.


        :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
        :suss:"All programmers are playwrights and all computers are lousy actors."

        1 Reply Last reply
        0
        • N Nnamdi Onyeyiri

          I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.


          :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
          :suss:"All programmers are playwrights and all computers are lousy actors."

          R Offline
          R Offline
          Ray Cassick
          wrote on last edited by
          #4

          I don;t think that this is something that could be done at the control level. Using tab to move from control to control is IMHO more of a form level process. I would hate to think that a control would be allowed to grab focus and not let it go like that. If you want to achive it at the form level just set the tabstop property of all the other controls to false and focus will have no where to go. If you are trying to do this in a custom control you are writing then I don't think that you can.

          N 1 Reply Last reply
          0
          • R Ray Cassick

            I don;t think that this is something that could be done at the control level. Using tab to move from control to control is IMHO more of a form level process. I would hate to think that a control would be allowed to grab focus and not let it go like that. If you want to achive it at the form level just set the tabstop property of all the other controls to false and focus will have no where to go. If you are trying to do this in a custom control you are writing then I don't think that you can.

            N Offline
            N Offline
            Nnamdi Onyeyiri
            wrote on last edited by
            #5

            it must be possible, im sure the TextBox/RichTextBox classes that come with the frameowkr can do it.


            :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
            :suss:"All programmers are playwrights and all computers are lousy actors."

            R 1 Reply Last reply
            0
            • N Nnamdi Onyeyiri

              it must be possible, im sure the TextBox/RichTextBox classes that come with the frameowkr can do it.


              :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
              :suss:"All programmers are playwrights and all computers are lousy actors."

              R Offline
              R Offline
              Ray Cassick
              wrote on last edited by
              #6

              Hmmmm you learn someting new every day I guess. I never noticed that the RichText control has a AcceptsTab property....

              1 Reply Last reply
              0
              • N Nnamdi Onyeyiri

                I need to make my control such that it does not loose focus when the user clicks the tab button, how would i go about doing this. I have tried capturing it in the OnKey.. event, but the control still looses focus.


                :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
                :suss:"All programmers are playwrights and all computers are lousy actors."

                B Offline
                B Offline
                bfarley
                wrote on last edited by
                #7

                Did you try KeyDown instead of KeyPress? Are you canceling the event in your handler with SystemEventArgs.Cancel? Bill F

                N 1 Reply Last reply
                0
                • B bfarley

                  Did you try KeyDown instead of KeyPress? Are you canceling the event in your handler with SystemEventArgs.Cancel? Bill F

                  N Offline
                  N Offline
                  Nnamdi Onyeyiri
                  wrote on last edited by
                  #8

                  i was always using KeyDown, but i didnt try cancelling the event, ill try that.


                  :suss: Email: theeclypse@hotmail.com   URL: http://www.onyeyiri.co.uk
                  :suss:"All programmers are playwrights and all computers are lousy actors."

                  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