Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi i have a wpf user control and wpf textbox control in a page, when i pressed on Tab in keyboard it's not going to next control which is a normal textbox. i had set the property tabstop to false and even true but nothing worked...

i have searched all the way but i can't find the solution, kindly give me a better solution to do this.

XML
<StackPanel Orientation="Vertical">
      (User Control)
      <controls:UserControl x:Name="txt_Name" Header="Name"/>

       (Normal TextBox Control)
      <StackPanel Orientation="Vertical" Margin="10">
          <Label Content="Size" VerticalAlignment="Top" />
          <TextBox Name="txt_size"/>
      </StackPanel>

       (Normal TextBox Control)
      <StackPanel Orientation="Vertical" Margin="10">
         <Label Content="Age" VerticalAlignment="Top" />
         <TextBox Name="txt_age"/>
      </StackPanel>

        (User Control)
      <controls:UserControl x:Name="txt_primaryActivity"  Header="Primary Activity"/>
  </StackPanel>
Posted
Updated 19-Jan-15 20:29pm
v6
Comments
LLLLGGGG 19-Jan-15 13:22pm    
Use TabIndex property to set the tabIndex if something goes wrong with the default one
Sergey Alexandrovich Kryukov 19-Jan-15 16:17pm    
Of course. And of course TabStop should be set to true, not false. :-)
—SA
Ranjith Mameras 20-Jan-15 1:06am    
i have set it to true but not working, the cursor stops on that normal control. there is no issue with user control tab index but when i combine both user control and normal control in my page tab index not working.
Sergey Alexandrovich Kryukov 20-Jan-15 1:12am    
Now check the TabIndex value, take into account hierarchy of control. It's all easy...
—SA
Ranjith Mameras 20-Jan-15 1:32am    
i have set it to true and also entered tab index values but when you click on tab it just skip the normal control and move over the user control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900