none
ContainerControl - "View Tab Order" showing too much RRS feed

  • Question

  • Revised.

    Background:  In Microsoft Visual Studio when a person is developing a Windows Forms Application, they drop controls on the form.  Later on they decide that the tab order is wrong and want to fix it.  So, at design time, click on the Visual Studio Menu "View" and then "Tab Order".  This reveals a lot of blue hints on top of the form which can be clicked to reset tab order.  

    Problem:  For container controls like a TabControl, only the visible page is shown.  I have a control I developed which is much like this.  When I attempt to set the tab order, it is showing the blue hints for ALL pages below the top one making it almost impossible to click on the desired tab order hint.

    Below is a simple example showing proper behavior of a TabControl on the right and my control on the left.  Each page of the tab control and my control have five buttons on them in a single column.

    Now when we reveal the tab order in visual studio (click on studio's View menu, then "Tab Order")

    You can see that the controls from "Page2" on my control are "bleeding thru" from below.  The TabControl seen on the right also has a column of 5 buttons on TabPage2 which are not being shown.  This is the proper behavior I am trying to achieve.

    What concept do I need to read about to get my ContainerControl behaving like a TabControl?  Is it an interface I need to implement or a method I need to override?



    • Edited by MarkC0001 Tuesday, September 25, 2012 3:45 PM
    Friday, September 21, 2012 3:23 PM

Answers

  • I was toggling page.Enabled, but not page.Visible.

    Changing page.Visible to false in the designer worked!  Thank you.

    "When we put a control on a form in designer, the designer will call the constructor to create the UI..."

    It will be some time before I can try that.  The impending release of Windows 8 has changed my priority list.

    Wednesday, September 26, 2012 2:41 PM

All replies

  • Hi Mark,

    Welcome to the MSDN Forum.

    What is the the number labels? Are they Labels?

    What do the numbers mean?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, September 24, 2012 10:48 AM
    Moderator
  • On any windows program when you click on Edit (menu) -> View Tab Order it will show those blue hints.  You click on them to set the tab order.  On a traditional TabControl which has more than one page, you see only the tab order of the visible page.  My control is showing all of the tab order hints of all of the controls underneath the visible page.  It doesn't matter if my design-time code sets those pages to disabled or visible=false...  So the bottom ones are "bleeding through".  Also in a traditional TabControl, each page increments the 0.0.#.0 number causing a tree-like hierarchy.  My control seems to be hosting all of the controls at the same level (0.0.0.#) and I have not found one spec of microsoft documentation on this behavior.  The parenting and ownership seems to be in order...  Have not found any interfaces to implement or functions to override.  

    What is it in a design-time Windows Forms environment that causes that treelike hierarchy to be recognized?

    Monday, September 24, 2012 2:26 PM
  • Hi Mark,

    >>On any windows program when you click on Edit (menu) -> View Tab Order

    I think this is in your application. But now I don't have your application. I don't know how do you implement the "View Tab Order". So would you like to tell us how you implement this feature?

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, September 25, 2012 5:11 AM
    Moderator
  • Sorry, tab order is really basic stuff to all Windows Forms applications.  "View Tab Order" is a menu in the MICROSOFT VISUAL STUDIO product - not part of my application.  You click it so that you can see and fix the tab order within the application being developed. 

    Please see this to understand this basic feature of VisualStudio.  

    http://msdn.microsoft.com/en-us/library/bd16a8cw(v=vs.100).aspx

    I'm still hoping an advanced component developer will put me on the right path on where to read about this in the MSDN.  It has to be in there somewhere.  I can see that my original request has confused you.  I will make a more clear example. and edit the above.

    Tuesday, September 25, 2012 3:20 PM
  • Hi Mark,

    Thank you for your clarification.

    The root cause is the tab control didn't create the second tab page when it is invisible, but your tabs are created anyway.

    Please check the note in the webpage your posted:

    Note

    Controls that cannot get the focus, as well as disabled and invisible controls, do not have a TabIndex property and are not included in the tab order. As a user presses the TAB key, these controls are skipped.

    When we put a control on a form in designer, the designer will call the constructor to create the UI.

    Even on the runtime, the invisible tabPage is not created till it is active. So you can also do the similar way: keep the object, but without UI, when it is needed to show, create UI.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, September 26, 2012 6:49 AM
    Moderator
  • I was toggling page.Enabled, but not page.Visible.

    Changing page.Visible to false in the designer worked!  Thank you.

    "When we put a control on a form in designer, the designer will call the constructor to create the UI..."

    It will be some time before I can try that.  The impending release of Windows 8 has changed my priority list.

    Wednesday, September 26, 2012 2:41 PM