Re: Dialog Based App
Overriding OnOK and OnCancel will have nothing to do with the Multiline Edit
control. (as long as you haven't done anything with the enter key in
PreTranslateMesssage). Just make sure that the Edit control has the Want
Return flag set.
As far as the close button on the caption goes, if you want it to still work
then don't override OnCancel, but that comes with the Esc key.
One possibility is this:
void CMyDialog::OnCancel()
{
if (MessageBox("Are you sure you want to
exit?","Exit",MB_YESNO|MB_ICONQUESTION) == IDYES)
{
CDialog::OnCancel();
}
}
AliR.
"Leon_Amirreza" <amirreza_rahmaty@yahoo.com> wrote in message
news:umtw6CRwGHA.5024@TK2MSFTNGP04.phx.gbl...
thanks
overriding onok , oncancel to empty functions would cause the multi line
text in the dialog not see the enter key (to go to the next line) and the
close box in the title bar does nothig!
what should i do then ?
(sorry for the foolish question but i am a newbie in c++)
"Mihai N." <nmihai_year_2000@yahoo.com> wrote in message
news:Xns9821714A6ED2MihaiN@207.46.248.16...
Try to catch the Key pressed Event for ENTER and ESCAPE in
PretranslateMessage to do the own processing.
More "MFC like" is to override OnCancel() and OnOK() to do what you
want.
Mihai
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email