In WPF, how does one jump out of the tab loop from the toolbar?

Source: Internet
Author: User
Tags mscorlib
In WPF, how does one jump out of the tab loop from the toolbar?
Zhou yinhui

In WPF. When the tab key is used continuously in the toolbar, it will loop with it. You can run the following Code And found the problem:< Window Xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation" Xmlns: SYS = "CLR-namespace: system; Assembly = mscorlib" Xmlns: x = "Http://schemas.microsoft.com/winfx/2006/xaml"   >

  < Dockpanel >
< Toolbar Dockpanel. Dock = "TOP"   >

< Button Content = "B"  
Command = "Editingcommands. togglebold"   />
< Button Content = "U"  
Command = "Editingcommands. toggleunderline"   />
< Button Content = "I"  
Command = "Editingcommands. toggleitalic"   />
</ Toolbar >
< RichTextBox />
  </ Dockpanel >  

</ Window >

How can we jump out of this loop? It's easy to set the tabnavigation attribute of tabbar to continue :)
Run the following code and you will find that the tab key focus can jump from the button "I" to RichTextBox.

< Window Xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation" Xmlns: SYS = "CLR-namespace: system; Assembly = mscorlib" Xmlns: x = "Http://schemas.microsoft.com/winfx/2006/xaml"   >

  < Dockpanel >
< Toolbar Dockpanel. Dock = "TOP"  
Keyboardnavigation. tabnavigation = "Continue" >
< Button Content = "B"  
Command = "Editingcommands. togglebold"   />
< Button Content = "U"  
Command = "Editingcommands. toggleunderline"   />
< Button Content = "I"  
Command = "Editingcommands. toggleitalic"   />
</ Toolbar >
< RichTextBox />
  </ Dockpanel >  

</ Window >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.