+ 2

Text box in Visual Studio

Hi everybody. How to make a group box from a few text boxes in Visual Studio. Let's say I have created 4 text boxes in WPF, and how to enable automatic access to the second text box, when user filled first one? I mean, like this one : https://www.dropbox.com/t/K0ySyJFUJJvbCphw

2nd Aug 2020, 5:20 PM
Sultonbek Rahimov
Sultonbek Rahimov - avatar
1 Answer
As far as I know. A group box in wpf is just an visual appearance. The groupbox does not enforce grouped behaviour. Like a radiobutton control. Also the radiobutton control only can do its behaviour for checkboxes. Uncheck a radiobutton if an other one is checked. This means you have to code the behaviour yourself. In wpf this is quitte complex. Use the PreviewKeyDown event or PreviewKeyUp to check if the fourth character is enter in the box. If the fourth character in a textbox is enterred use TraversalRequest, FocusNavigationDirection, MoveFocus to focus the next element. Read about it in the following links. https://stackoverflow.com/questions/8203329/moving-to-next-control-on-enter-keypress-in-wpf
2nd Aug 2020, 9:02 PM
sneeze - avatar