[2008] Flustered with Forms & Focus
I'm working with some embedded forms and I'm getting some strange behavior that I'm sure is explainable, but that I cannot explain.
So, I have my main Windows Form. This has a TabControl with 4 TabPages. Then I load, depending on which is active, a new form into the Tabpages, without borders, and with TopLevel = False. This new form itself has three panels, one of which contains a TabControl in which I load another form onto its tabpages.
When I write it out like that I get this sense that I'm doing things in a complicated way. But I don't know no betta'. Anyway, my problem is that On that third form I load into the second form, I can't get any tab performance. I can click on a control within that third form, but if I press the tab key from within the third form, it jumps over to the next control in my second form.
I sense that it has something to do with "z-Order" but I don't know how to use it, or just what it means, exactly. When I tab through the controls in my Main form as the program is running I can see the Active TabPage highlight, and if I use my arrow key at this point I can move between the TabPages on this embedded control, but I can't seem to get the tabOrder to move into the particular tabpages.
Thank you for any help.
Re: [2008] Flustered with Forms & Focus
in the view menu (in design mode) theres a tab order menuitem which will give you a visual idea of your taborder
Re: [2008] Flustered with Forms & Focus
It's all about "TabIndex" on all your controls.
If all your main form has is a tab-control, set each page to like 0, 200, 400...
Inside each tab, your containers take precedence. I do my panels by 50's.
If you got a ton of controls, it takes time and is a pain in the rear, but not too hard to maintain if you have "holes" in your numbers you can use if you have to. Remember to TabStop = False on controls you want to exclude.
Re: [2008] Flustered with Forms & Focus
Yeah, I know about TabOrderView. I don't know how it is supposed to help, however.
Re: [2008] Flustered with Forms & Focus
Ok, thanks Jenner. I'll give it a try. It just seems to ignore the tab pages entirely. Just skips right over them, automatically. I'll try again, though.
Re: [2008] Flustered with Forms & Focus
Tab will only highlight the "Tab" of a tabcontrol, it's up to the user to use the arror keys to change tabs. It won't go to the next tab automatically. I don't know if there's a way to make it do so without programming either.
Re: [2008] Flustered with Forms & Focus
Yeah, I'm fine with that. The user can use the arrow keys to choose between tabs. But maybe you can explain this: what's the difference between the outermost TabControl on my MainForm and the TabControl that is within this outermost TabControl? Because whatever controls exist directly within the outermost TabControl work fine and can be tabbed between, but whatever controls exist within the inner TabControl do not work fine in terms of tab functionality.
I would think that if a control within my innermost TabControl had focus and I hit the tabkey that it would give focus to the next control within that nested TabControl, but instead it gives it to the next control in that TabControls parent TabPage. Know what I mean?
Re: [2008] Flustered with Forms & Focus
Put another way: I can use the TabIndex property of a particular control to change the TabOrder of that control within its container, but how do I activate a container itself for tabbing? Because the container within which my valued controls reside is itself apparently not activated in the tabbing scheme.
Re: [2008] Flustered with Forms & Focus
Re: [2008] Flustered with Forms & Focus
The container's tabstop is activated. It's just being skipped over. That's what I want to know. How do I stop a container from being skipped over.
Re: [2008] Flustered with Forms & Focus
thats why i suggested checking your tabindexes
Re: [2008] Flustered with Forms & Focus
But I've done that. It's not an issue with tabindexes (at least not in this obvious manner). It's an issue with having embedded forms. I have Form1 which contains Form2 which contains Form3. Whenever I try and tab between controls in Form3 I am automatically brought into the controls in Form2.
I have Form1 set to IsMDIContainer. But I cannot Set Form2 to IsMDIContainer because then I can't embed it in a tabpage. This is probably where the problem is, eh?