SetActivePage with Property Sheet in VC1.52c ??
Rail J. Rogut -- railro@earthlink.net Sunday, February 16, 1997 Environment: VC++ 1.52, VC++ 4.1, Win3.1, Win 95 Hi to all, The following code, which works under V4.1 (32 bit), does not quite do the trick with VC++ 1.52c. I was wondering if anyone else has managed to get this to work correctly - before I waste too much time on it. What I have is a PropertySheet with 2 pages: COffset and CSelectTracksDlg. I have a CBitmapButton in the same location on both pages with which I let the user toggle between the 2 pages. COffset is the first page and it's button is mapped to: void COffset::OnNextPage() { // For Win95: // ((CPropertySheet*)GetParentOwner())->SetActivePage(1); // For Win3.11: ((CPropertySheet*)GetParent())->SetActivePage(1); } CSelectTracksDlg is the 2nd page & it's button is mapped to: void CSelectTracksDlg::OnPrevPage() { ((COffsetSheet*)GetParent())->SetActivePage(0); } The pages do seem to switch, but the dialogs aren't repainted - so it ends up with the wrong controls (invisible) on top of the wrong page. I've thought of Invalidating the dialog - but that doesn't switch the tab indication. Any input would be appreciated. Thanks. Rail Oceanway Recording railro@earthlink.net
sunil -- sunil@fcpl.co.in Monday, February 17, 1997 Following is the code that may help U replace the single statement of SetActivePage in both the handlers with these statements. ShowWindow(SW_HIDE); ((CPropertySheet*)GetParent())->SetActivePage(1 OR 0); m_tabRow.SetCurSel(1); You need to write the last statement because it seems that VC1.52/VC2.0's CPropertySheet::SetActivePage() does not handle setting of tab along with the page.and it stores the current active tab separately ---------- From: Rail J. Rogut[SMTP:railro@earthlink.net] Sent: Sunday, February 16, 1997 10:46 PM To: MFC-L Subject: SetActivePage with Property Sheet in VC1.52c ?? Environment: VC++ 1.52, VC++ 4.1, Win3.1, Win 95 Hi to all, The following code, which works under V4.1 (32 bit), does not quite do the trick with VC++ 1.52c. I was wondering if anyone else has managed to get this to work correctly - before I waste too much time on it. What I have is a PropertySheet with 2 pages: COffset and CSelectTracksDlg. I have a CBitmapButton in the same location on both pages with which I let the user toggle between the 2 pages. COffset is the first page and it's button is mapped to: void COffset::OnNextPage() { // For Win95: // ((CPropertySheet*)GetParentOwner())->SetActivePage(1); // For Win3.11: ((CPropertySheet*)GetParent())->SetActivePage(1); } CSelectTracksDlg is the 2nd page & it's button is mapped to: void CSelectTracksDlg::OnPrevPage() { ((COffsetSheet*)GetParent())->SetActivePage(0); } The pages do seem to switch, but the dialogs aren't repainted - so it ends up with the wrong controls (invisible) on top of the wrong page. I've thought of Invalidating the dialog - but that doesn't switch the tab indication. Any input would be appreciated. Thanks. Rail Oceanway Recording railro@earthlink.net
Rail J. Rogut -- railro@earthlink.net Tuesday, February 18, 1997 sunil wrote: > ShowWindow(SW_HIDE); > ((CPropertySheet*)GetParent())->SetActivePage(1 OR 0); > m_tabRow.SetCurSel(1); > > You need to write the last statement because it seems that VC1.52/VC2.0's CPropertySheet::SetActivePage() does not handle setting of > tab along with the page.and it stores the current active tab >separately Thanks. It's funny, I tried that but it wouldn't redraw the TabCtrl highlight to show the tab in bold (everything else was okay) - so I ended up using: #includeBOOL COffsetSheet::SetPage(int nPage) { SetActivePage(nPage); SendMessage(TCM_TABCHANGING, 0, 0); return m_tabRow.SetCurSel(nPage); } the call to TabChanging() did it. Thanks for the help tho' - I knew someone must have figured this one out already. Rail Oceanway Recording railro@earthlink.net
Become an MFC-L member | Вернуться в корень Архива |