Dissappearing window in CTabCtrl
Posted on 2003-03-16
I'm creating a MFC dialog based application in VC6. The dialog only contains one control; a CTabCtrl. Each page of the tab control is linked to another dialog (with its own CDialog-derived class). All the page dialogs are created in the main dialog with the tab control as the parent. Each page dialog is then hidden and only the correct one is shown. When a tab is changed, the current page is hidden and the new page is shown (usign ShowWindow(SW_HIDE) or ShowWindow(SW_SHOW)).
The above part all works and the pages are shown as expected. The problem comes when any control on the page dialog has the focus and I press ENTER. The page then dissapears. It is not destroyed, since it reappears when I switch tabs and then back to the page where I was. It is almost as if it is moved to below the tab control, or if some code redraws over my dialog page. If, for example, a edit control has the focus and I press ENTER, the page dissapears. If I type some characters, switch tabs and switch tabs again back to the original page, my page is shown again with the text typed in the edit control.
I've tried to set break points to all the message handlers I could think of without any success. I can not find why the page is hidden.