inside groupbox tab Index is not working properly

Bloqueada inside groupbox tab Index is not working properly

  • mercredi 1 août 2012 10:17
     
     

    Hi,

    I have two group box in form each group box have some text boxes and button control.
    for ex: 
     groupbox 1 have 3 textbox and 1 button
     groupbox 2 have 3 textbox and 1 button

    I have given tabIndex first to text box and then to button


    group box 1

    Textbox1 - tabindex = 0
    Textbox1 - tabindex = 1
    Textbox1 - tabindex = 2
    button -  tabindex = 6

    group box 2
    Textbox1 - tabindex = 3
    Textbox1 - tabindex = 4
    Textbox1 - tabindex = 5
    button -  tabindex = 7



    Problem is tab Index is not working properly. Afert third text box of groupbox 1 it goes to button of groupbox one.

    I want tab index like above Please suggest how can I do.

    Thanks

Toutes les réponses

  • mercredi 1 août 2012 12:36
     
     Traitée

    I would recomend you to set indexes ones agian - in form designer:

    1. click on View menu on top, and select TabOrder.

    2. then with a mouse click define new order (1st click on both groupboxes, then go into each of them and click control by control - as you want them to be aligned).

    Then again do 1st point (to close tbOrder).


    Mitja

  • mercredi 1 août 2012 13:05
     
     
    Each 'container' has its own tab order and so the controls in GroupBox1 will therefore be tabbed through before those in GroupBox2.

    With Thanks and Regards
    Sambath Raj.C
    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you
    Happy Programming!

  • mercredi 1 août 2012 14:48
     
     

    Did but Same problem.

    Tab goes

    Groupbox1 : textbox1

    Groupbox1 : textbox2

    Groupbox1 : Button

    Groupbox2 : textbox1

    Groupbox2 : textbox2

  • mercredi 1 août 2012 15:37
     
     


    Problem is tab Index is not working properly. Afert third text box of groupbox 1 it goes to button of groupbox one.

    PLEASE read my post above. Look at this image:


    Mitja

  • jeudi 2 août 2012 07:51
     
     

    Problem is tab Index is not working properly. Afert third text box of groupbox 1 it goes to button of groupbox one.

    PLEASE read my post above. Look at this image:


    Mitja


    Yes I now but I want to know is there any way Tab will go to 1,0 texbox after 0,2. I dont want to do it manually  like on leave event of textbox 0,2 set focus on text 1.0

    • Modifié to.areeb jeudi 2 août 2012 07:53
    •  
  • jeudi 2 août 2012 11:50
     
      A du code

    You can set it by code:

    Subscribe to KeyUp event or button1 control:

            private void button1_KeyUp(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Tab)
                {
                    textBox3.Focus();
                }
            }



    Mitja

  • lundi 6 août 2012 07:10
     
      A du code
    In this case focus will not come to button.  When I'll come to button using tab then keyup event fire and focus goes to textbox.

    You can set it by code:

    Subscribe to KeyUp event or button1 control:

            private void button1_KeyUp(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.Tab)
                {
                    textBox3.Focus();
                }
            }



    Mitja