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. Ho do I suppress the Tab key, or control tabbing to a nested user control?

Ho do I suppress the Tab key, or control tabbing to a nested user control?

Scheduled Pinned Locked Moved C#
winformshelpquestion
5 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.
  • P Offline
    P Offline
    Poolee
    wrote on last edited by
    #1

    Hi there, I someone can help me... this is driving me nuts... I have a form (with textboxes and buttons) with dynamically created user controls (BasePanel) when the user presses the Add button. On that user control is a textbox. When that user control gets created, one of two possible user controls (GeneralEntry - initially - or EventEntry) are added to that user control, which contains a series of maskedtextboxes. If the user types a letter in this first maskedtextbox, then the GeneralEntry gets replaced with the EventEntry user control, which has a different series of maskedtextboxes. Now, what I want to have happen is that on the last textbox on the form, when the user presses Tab, it goes to the first maskedtextbox on the GeneralEntry, but it doesn't... it goes to the textbox on the BasePanel. I have tried assigning all the tab orders so that the all in the correct order, but there seems to be a precedence of controls... form, then user control, then next user control, etc... I have also tried suppressing the Tab key and forcing the SelectNextControl... but that's not working either, as the Tab key doesn't seem to be able to be suppressed or handled. Does anyone have any suggestions please? Thanks in advance! Paul

    One day I want to be a code monkey. Right now, I'm more like a code amoeba...

    D 1 Reply Last reply
    0
    • P Poolee

      Hi there, I someone can help me... this is driving me nuts... I have a form (with textboxes and buttons) with dynamically created user controls (BasePanel) when the user presses the Add button. On that user control is a textbox. When that user control gets created, one of two possible user controls (GeneralEntry - initially - or EventEntry) are added to that user control, which contains a series of maskedtextboxes. If the user types a letter in this first maskedtextbox, then the GeneralEntry gets replaced with the EventEntry user control, which has a different series of maskedtextboxes. Now, what I want to have happen is that on the last textbox on the form, when the user presses Tab, it goes to the first maskedtextbox on the GeneralEntry, but it doesn't... it goes to the textbox on the BasePanel. I have tried assigning all the tab orders so that the all in the correct order, but there seems to be a precedence of controls... form, then user control, then next user control, etc... I have also tried suppressing the Tab key and forcing the SelectNextControl... but that's not working either, as the Tab key doesn't seem to be able to be suppressed or handled. Does anyone have any suggestions please? Thanks in advance! Paul

      One day I want to be a code monkey. Right now, I'm more like a code amoeba...

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Some keys are treated in different way than others. Probably tab key is one of them. I think you will need to handle that in ProcessCmdKey method.

      "If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry

      P 1 Reply Last reply
      0
      • D dan sh

        Some keys are treated in different way than others. Probably tab key is one of them. I think you will need to handle that in ProcessCmdKey method.

        "If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry

        P Offline
        P Offline
        Poolee
        wrote on last edited by
        #3

        Thanks for that Dave. A bit of a learning curve to use that method, but it seems like it will meet my needs. Cheers Paul

        One day I want to be a code monkey. Right now, I'm more like a code amoeba...

        D 1 Reply Last reply
        0
        • P Poolee

          Thanks for that Dave. A bit of a learning curve to use that method, but it seems like it will meet my needs. Cheers Paul

          One day I want to be a code monkey. Right now, I'm more like a code amoeba...

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Poolee wrote:

          Thanks for that Dave.

          :confused: Who's Dave?

          "If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry

          P 1 Reply Last reply
          0
          • D dan sh

            Poolee wrote:

            Thanks for that Dave.

            :confused: Who's Dave?

            "If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry

            P Offline
            P Offline
            Poolee
            wrote on last edited by
            #5

            LOL, got the name from the siggie... *slaps self repeated ly* :laugh:

            One day I want to be a code monkey. Right now, I'm more like a code amoeba...

            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