开发者

WPF: DataBinding a ListBox where each item is a Tab Stop

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.

Is there a way to make each TextBox inside the ListBox be tabbable (or perhaps another type of databound control that开发者_如何学JAVA would work)?

Thanks


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.

Something like:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜