开发者

How to tab through components and stay inside same FocusScope?

开发者 https://www.devze.com 2023-04-03 23:58 出处:网络
I have a wpf window with multiple panels. Each panel is a focus scope and contains a few textboxes. If the user tabs through the textboxes in one panel, the Keyboard focus should never jump out of thi

I have a wpf window with multiple panels. Each panel is a focus scope and contains a few textboxes. If the user tabs through the textboxes in one panel, the Keyboard focus should never jump out of this panel. Once the last textfield in the focos scope loses its focus, the Keyboard focus 开发者_开发知识库should continue with the first field of the same focus scope.

Can this be accomplished with native c# behaviour?


You need to set the following two properties for that behavior:

FocusManager.IsFocusScope="True"
KeyboardNavigation.TabNavigation="Cycle"
0

精彩评论

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