zoukankan
html css js c++ java
WPF中,如何从Toolbar中跳出Tab循环
WPF中,如何从Toolbar中跳出Tab循环
周银辉
WPF中. 在Toolbar中连续使用Tab键时,其会循环与其中.你可以运行以下代码并发现该问题:
<
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
>
如何跳出该循环呢, 很简单, 将TabBar的
TabNavigation
属性设置为Continue就可以了 : )
运行以下代码你会发现, Tab键焦点可以从按钮"I"跳转到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
>
查看全文
相关阅读:
好友面板切换案例
jquery
H5 新增API
深拷贝
浅拷贝
call bind apply
像素鸟
Django3.0
三剑客-grep-awk-sed
Linux中find命令详解
原文地址:https://www.cnblogs.com/zhouyinhui/p/742096.html
最新文章
SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis)
chrome使用技巧
js跨域及解决方案
二分查找
冒泡排序
Spring IOC的三种注入方式
ajax原理
重力加速度陀螺仪传感器MPU-6050(一)
Windows Linux HackMacintosh
Google设计理念
热门文章
常见的无线模块
为什么要在密码里加点“盐”
jquery鼠标样式
jquery改变多个css样式
JS访问Struts 2 ValueStack中的内容
前端开发
OpenSUSE共享网络
高亮显示 + 手风琴
淘宝精品服饰案例
下拉菜单
Copyright © 2011-2022 走看看