WPF:绑定列表框,其中每个项目是一个制表位 [英] WPF: DataBinding a ListBox where each item is a Tab Stop

查看:111
本文介绍了WPF:绑定列表框,其中每个项目是一个制表位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚建立了一个WPF的形​​式,其中包含一个列表框。该列表已绑定到它的TextBox控件列表。我需要让每一个TextBox控件一个接受tab让用户可以在多个命中选项卡,类型,在未来的数,等再次和类型打标签。

I just built a WPF form that contains a ListBox. The ListBox has bound to it a list of TextBox controls. I need to make each TextBox control a TabStop so that a user can hit tab, type in a number, hit tab again and type in the next number, etc.

但问题是,列表框本身捕捉选项卡,然后下一个标签跳转到列表框后,下面的控制。

Problem is, the ListBox itself catches the tab then the next tab skips to following control after the ListBox.

有没有一种方法,使每一个文本框列表框里面是tabbable(或者是另一种类型的数据绑定控件,将工作)?

Is there a way to make each TextBox inside the ListBox be tabbable (or perhaps another type of databound control that would work)?

感谢

推荐答案

嗯,我们真的没有足够的信息来回答这个问题(这要看是什么模板和样式列表框使用),但你可能需要与KeyboardNavigation.TabNavigation财产剧透的项目,以改变如何循环和列表框设置为false IsTabStop。

Well we don't really have enough information to answer the question (this depends on what Templates and Style the ListBox is using) but you'll potentially need to play with the KeyboardNavigation.TabNavigation property to change how to cycle through the items and set IsTabStop on the ListBox to false.

是这样的:

<ListBox DataSource={Binding} IsTabStop="False" KeyboardNavigation.TabNavigation="Cycle" />

这篇关于WPF:绑定列表框,其中每个项目是一个制表位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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