|
-
June 3rd, 1999, 04:25 PM
#1
Return key press in Dialogs
Hello,
I am having just the opposite problem as "Dialog Focus Blues." Two dialogs in my application have desired behaviors switched and I do not know why.
The first is a login dialog. It has default styled button, a list box (users) and a password field. I would like the return key to simulate a click in the default button.
The second is a setup dialog. This dialog contains sub-CDialogs. The return key dismisses the parent dialog unless the control style is set true on the sub-dialogs and I have not switched which sub-dialog is visible.
Both dialogs have identical style attributes.
I believe ::IsDialogMessage is trapping and altering the return key message in the one dialog. What piece of logic do I not understand?
Thank you
Dave Giovannini
-
June 4th, 1999, 06:02 AM
#2
Re: Return key press in Dialogs
For the first case override the OnOK() fucntion like this:
void CMyDialog::OnOK()
{
OnClickedDefaultButton();
}
For the second:
I do not understand very well the problem.
-
June 4th, 1999, 12:46 PM
#3
Re: Return key press in Dialogs
I found that the following conditions needed to be met for the return/esc keys to work in my login dlg.
The buttons must have IDs IDOK and IDCANCEL. The IDOK button cannot be remapped to another method. This is probably why OnOK is virtual.
As far as the other problem. The odd thing is there is no default button an ony of the dialogs. I guess I can just override OnOK and have do nothing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|