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