I've created a modeless dialog with a simple edit box in it. I want the
user to be able to enter text through the edit box. I have found that if
the user presses the ENTER key while in the edit box, the message to
CLOSE the dialog gets issued. I don't want this. Ideally, if the user
presses ENTER after typing text in the edit box, I would like it to
accept the text typed, as if the "Apply" button had been clicked, but I
do not want it to close the dialog - only the CLOSE button gets to do
that.
Thank you in advance,
Mark Roberts
Toronto, Canada
"Mark Roberts" <mcro...@sympatico.ca> wrote in message
news:3AC614D4...@sympatico.ca...
void CYourDialog::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
To solve your problem, do this:
void CYourDialog::OnOK()
{
// TODO: Add extra validation here
// CDialog::OnOK(); <<<<<<---- look at this line!!!!!
}
That's all!
HTH,
Massimo.
On Sat, 31 Mar 2001 17:33:21 GMT, Mark Roberts
<mcro...@sympatico.ca> wrote:
>I've created a modeless dialog with a simple edit box in it. I want the
>user to be able to enter text through the edit box. I have found that if
>the user presses the ENTER key while in the edit box, the message to
>CLOSE the dialog gets issued. I don't want this. Ideally, if the user
>presses ENTER after typing text in the edit box, I would like it to
>accept the text typed, as if the "Apply" button had been clicked, but I
>do not want it to close the dialog - only the CLOSE button gets to do
>that.
mailto:m.col...@softhor.com
http://www.softhor.com/developmentarea
ICQ# 96413649
/**************************************************
"I've... seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams... glitter in the dark near the
Tanhauser Gate.
All those... moments will be lost... in time...,
like... tears... in... rain."
Blade Runner.
**************************************************/