Tab Control
-
I have a tab control that contains child dialogs. I have been able to add the dialogs OK, and they show up, but when I press Enter or Escape (both mapped to default buttons on the dialog), all of my controls disappear. I have heard that I may have to override EndDialog, since this is probably being called, but I was wondering if anyone else has a better solution. I don't want to use Property Sheets, and I know this can be done with dialogs. Any help would be greatly appreciated.
-
I have a tab control that contains child dialogs. I have been able to add the dialogs OK, and they show up, but when I press Enter or Escape (both mapped to default buttons on the dialog), all of my controls disappear. I have heard that I may have to override EndDialog, since this is probably being called, but I was wondering if anyone else has a better solution. I don't want to use Property Sheets, and I know this can be done with dialogs. Any help would be greatly appreciated.
look this code: BOOL CYouChildDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class BOOL bHandledMsg = FALSE; switch (pMsg->message) { case WM_KEYDOWN: { switch (pMsg->wParam) { // hitting escape while searching for password edits // should only stop the search for password edits and // not kill app case VK_ESCAPE: bHandledMsg = TRUE; break; case VK_RETURN : bHandledMsg = TRUE; break; default: break; } // switch (pMsg->wParam) } break; default: break; } // switch (pMsg->message) return (bHandledMsg ? TRUE : CDialog::PreTranslateMessage(pMsg)); }