Tab顺序 [英] Tab Order

查看:88
本文介绍了Tab顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的WPF桌面应用程序,其中包含一些文本框和按钮,并且希望为这些控件设置Tab键顺序。我在msdn上找到了以下链接来描述如何执行此操作,但不幸的是,我的Format
菜单下没有Tab Order菜单项,我的WPF GUI显示在设计器中(只有一个Order菜单,它走到了Bring to前面或后面发送)。我的期望是看到类似View下的内容 - > Visual Studio 2008中的Tab顺序。

I have a a simple WPF desktop application with a few text boxes and buttons, and would like to set the tab order for these controls. I found the link below on msdn to describe how to do this, but unfortunately, I have no Tab Order menu item under my Format menu with my WPF GUI displayed in the designer (only an Order menu which walks to Bring to Front or Send to Back). My expectation is to see something like what was under View -> Tab Order in Visual Studio 2008.

http:// msdn。 microsoft.com/en-us/library/csz6b8x8.aspx

我还尝试通过转到每个控件的属性并设置IsTabStop来解决这个问题。属性为真还是假。这确实有效,但我仍然没有看到如何控制Tab键顺序。

I've also tried to sort this out by going to the properties of each control, and setting the IsTabStop property to true or false. That does work, but I still don't see how to control the sequence of the tab order.

谢谢,

Randy

Thanks,
Randy

 

推荐答案

您好Randy

Hi Randy

对于WPF和Silverlight应用程序,两者都是在Visual Studio 2010和2008中,我们还没有用于管理Tab Order的特定UI(您提到的文档是关于Windows Forms的,它确实有这个)。

For WPF and Silverlight applications, both in Visual Studio 2010 and 2008, we do not yet have specific UI for managing Tab Order (the document you referred to is about Windows Forms, which does have this).

有3种方式管理Visual Studio 2008和2010 WPF和Silverlight设计器中的Tab键顺序(Tab键顺序):

There are 3 ways of managing the sequence of tabbing (the Tab Order) in the Visual Studio 2008 and 2010 WPF and Silverlight designers:

1。通过移动XAML中元素的文档顺序来手动 - 因为WPF和SL使用文档顺序来默认确定Tab键顺序,以及Z顺序。

1. Manually by moving the document order of the elements around in the XAML - since WPF and SL use document order to determine tab order by default, as well as Z-order.

2。通过依次设置每个控件的 TabIndex属性手动 - 更高版本稍后在Tab顺序中 - 这将覆盖文档顺序

2. Manually by setting the TabIndex property of each control in turn - higher is later in the Tab Order - this overrides document order

3。在设计者中使用" Bring Forward / Send Backward"右键单击菜单选项以随机输入文档顺序 -
此方法利用了在WPF / Silverlight中默认情况下Z顺序和Tab顺序都设置为文档顺序的事实。设计师会根据这些菜单选项的使用情况更改文档顺序。

3. In the designer by using the "Bring Forward/Send Backward" right-click menu options to shuffle the document order - this approach leverages the fact that both Z-order and Tab Order are set to document order by default in WPF/Silverlight. The designer changes document order in response to the use of these menu options.

在一个简单的表单上尝试每一个,看看我的意思。在Z顺序不重要的情况下(例如大多数形式,元素之间没有重叠),方法3的效果非常好。

Try each of these out on a simple form to see what I mean. In cases where Z-order is unimportant (e.g. most forms, where there is no overlap between elements), method 3 works pretty well.

我希望这有帮助!

标记


这篇关于Tab顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆