Pergunta

When I make a dialog using CDialog project of VC++, I can not defocus any field on this dialog(CDialog). What I want to do is how some field can be defocused when I clicked the outside of this field with mouse.

Thanks for any advice and comments.

Foi útil?

Solução

The only obvious question: WHY? Why do you want to de-focus from a control, and (possibly) not give focus to any control? Some control within the dialog should have a keyboard focus!

You can however, make a textbox, which would be outside the visible area of dialog, and SetFocus on that control, whenever you get WM_MOUSE* message(s) on the CDialog.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top