开发者

FileChooser onFocus of text box C++

I want to bypass the need for a button to invoke a FileCh开发者_JAVA技巧ooser dialog in my application, so I'm setting it so that when the text box gains focus, the FileChooser just launches automatically.

This is easy to do, but the problem is that after the user selects a file and hits okay, the text box they were on is still in focus, so the FileChooser gets "stuck" and keeps reactivating.

I would just set it to jump to the next control box, but the next few boxes also launch a FileChooser, and I think it will be confusing for the user if the FileChooser appears to just stay there...they might think it is stuck.

Is there a way to remove focus from a control?

Thanks in advance for the help!


Instead of removing focus do this: Declare a variable for that textbox, like bool opened = false; Once the file chooser is opened, set it to true, and make sure before you open the file chooser you check if the variable is set to true or false, if it's false, open it, if it's true, leave it

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜