locked
Control tabIndex RRS feed

  • Question

  • Hello guys,

    I need control the tabindex and focus not using the XAML code.

    e.g:

    int IniciarCadastro = 0;
    
    switch (IniciarCadastro)
                    {
                        case 0:
                            numeroDocumentoTextBox.TabIndex = 0;
                            System.Windows.Browser.HtmlPage.Plugin.Focus();
                            numeroDocumentoTextBox.Focus();
                            
                            break;
    
                        case 1:
                            nomePessoaTextBox.TabIndex = 0;
                            System.Windows.Browser.HtmlPage.Plugin.Focus();
                            nomePessoaTextBox.Focus();
                            
                            break;

    When I use this code, my code respect the tabindex but when I use 'tab' my controls doesnt respect the order. How can I control this ?!

    Thanks !!


    Atenciosamente, Seratti. Se responder sua pergunta, marque, se apenas for util, marque.

    Thursday, November 1, 2012 12:28 PM

All replies

  • I loaded an example.

    http://www.4shared.com/zip/d7S-Iu3F/TESTES.html


    Atenciosamente, Seratti. Se responder sua pergunta, marque, se apenas for util, marque.

    Thursday, November 1, 2012 6:51 PM
  • You can name the tabs in xaml:

    <sdk:TabItem Header="Correspondence" Name="TabItemCorrespondance">

    Then in code behind you can just set the focus onto a particular tab:

    TabItemCorrespondence.IsSelected = True

    Monday, November 5, 2012 11:59 AM
  • pteare. Thanks for answer but I dont have doubt about TabItem or TabControl and yes about TabIndex. Please download the example that I uploaded and you will see about I'm saying.

    Atenciosamente, Seratti. Se responder sua pergunta, marque, se apenas for util, marque.

    Monday, November 5, 2012 1:08 PM
  • Someone ?

    Atenciosamente, Seratti. Se responder sua pergunta, marque, se apenas for util, marque.

    Wednesday, May 8, 2013 11:44 AM