The Textbox Control provided by dotnetbar modifies the default behavior. When you press enter, the focus will jump to other controls, and CTRL + enter will be the default behavior. Sometimes this function is not required for an input box on the interface. For example, for a textbox with multiple rows, you need to enter another line, and the focus is still on the textbox.
To solve this problem, you must first set the textbox's acceptenter to true, but setting this attribute only does not work. You also need to respond to the keydown event of textbox. When the keycode is enter, set handle to true and set supresskeydownevent to true.
Sometimes this method does not work. Dotnetbar has a textboxitem control. This method does not work even if the textbox control encapsulated by it responds to events. Another way is to start a timer (or a new thread) in response to the keydown event, and set the timer time to be particularly short, for example, 50 milliseconds, set the focus back to textbox in the response function.
Personal Homepage synchronously updated