Results 1 to 12 of 12

Thread: [2008] Flustered with Forms & Focus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    [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.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    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

  3. #3
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    Re: [2008] Flustered with Forms & Focus

    Yeah, I know about TabOrderView. I don't know how it is supposed to help, however.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    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.

  6. #6
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    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?

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    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.

  9. #9
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: [2008] Flustered with Forms & Focus

    the tabstop property.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    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.

  11. #11
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: [2008] Flustered with Forms & Focus

    thats why i suggested checking your tabindexes

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width