开发者

toolStripTextBox action on Enter

In a C# Winforms application, I am using a "toolStripTextBox" toolstrip control to capture some text that is to be used to filter some other content on the form.

The "toolStripTextBox" is selected from a "toolStripSplitButton".

The user can activate the textbox and ente开发者_运维知识库r text, but I am struggling to control the end of the user input. What I would like is for the user to press ENTER to complete the input.

I can detect that "ENTER" has been pressed with the key pressed events, but this does not remove the focus away from the text box.

Any ideas?


to send the focus to next control try the below code on same event

    e.Handled = true;
    System.Windows.Forms.SendKeys.Send("{TAB}"); // optional
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜