1 Replies - 3236 Views - Last Post: 14 May 2010 - 06:52 PM Rate Topic: -----

#1 Guest_tme321*


Reputation:

Setting Tab Order between MDI Child windows

Posted 14 May 2010 - 01:54 PM

I have an application that has an Mdi Container form. On this form among other controls there is a flow layout panel. When the form is first initialized a second form is added to this layout panel, setting TopLevel false, setting the MdiParent to the Mdi container form, and all that good stuff. This second form has various controls on it as well. Then, it can be necessary to add another one of these children forms onto the flow layout panel dynamically based on user interaction. So the program consists of one MDI container form, and one or more child forms attached to it and each form has various controls.

All of that stuff works like I want it to. However, I am having a small issue with interface for the forms. I can independently set the tab order inside the MDI container form, and inside the child forms that will be added dynamically. However, I find that once a child form is attached the user gets stuck inside the first child form. Tabbing does not switch either between the list of child forms nor does it go back to the top level container form. Mouse clicking and such works fine, but I would really like to enable tabbing through the whole thing.

Is there an easy way of doing this with something like the TabOrder property or do I have to do something much more complex? Is this going to require something like capturing the Tab keystroke with an event handler when it is in the last control of a form and moving focus down to the next child form manually? Or even is there an easier way of accomplishing what I am trying here, some way that doesn't use an MDI interface?

I am in no way tied to the idea of MDI per say, I just need the ability to dynamically add a panel and set of controls onto a top level form based on user interaction, and I would especially like the ability to design the child form through the VS GUI Designer, rather than manually typing in all of the controls properties and spacing and such.

Thanks for any help.

Is This A Good Question/Topic? 0

Replies To: Setting Tab Order between MDI Child windows

#2 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1211
  • View blog
  • Posts: 4,126
  • Joined: 27-January 10

Re: Setting Tab Order between MDI Child windows

Posted 14 May 2010 - 06:52 PM

I've never really done this, but if I were you I'd capture the KeyDown event, check if it's Tab, give focus() to the parent container, that way you can now tab through the various child containers.
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1