0
votes

I have one MFC Application. there is one CBUTTON. I had write code create CDialog on CBUTTON click. If i am use DOMODAL method for creating cdialog then keyboard tab working fine but if i am use CREATE method then keyboard tab not working.

1
What do you mean "keyboard tab not working"? What doesn't work? What do you expect to happen?Cody Gray
If i am press tab key then its not working. arrow key up-down working.when press tab key then it will lost the focus from dialog.kalpesh

1 Answers

2
votes

You probably are not calling the IsDialogMessage, which is required to ensure that modeless dialog boxes process keyboard input correctly.

This is not necessary with modal dialogs (i.e., those created by calling the DoModal method) because Windows handles it internally.

This doesn't make much sense as an explanation, though, because you're using MFC, which should ensure that IsDialogMessage is called in the message loop for modeless dialogs. That's the whole point of using a framework: it keeps you from forgetting details like this. I can't guess why it isn't working like it should for you; you didn't show us any code. Note that the Visual Studio wizards write the correct code for you automatically. It's recommended that you use them when adding new dialogs to your app.

Joseph Newcomer's article on Creating a Modeless Dialog Box with MFC might be helpful reading.