Hi all:
I use the normal way to create the Tab in MFC,
and I find a problem about Tab control, recently.
The Tab is abnormal after I opened the another application with User Account Control(UAC) in Win7.
Like this picture:
http://i.imgur.com/xntxhDV.jpg[
^]
When the problem happened, it still can use, and if I selected the another page in Tab, it's gonna normal!
I think it happened because the slices of display is not normal after the UAC...
Hope someone can give me a hand,
thank you!!
I pasted my Tab code below:
in OnInitDialog( ):
TCITEM tc1,tc2;
tc1.mask = TCIF_TEXT;
tc1.pszText = _T("page1");
tc2.mask = TCIF_TEXT;
tc2.pszText = _T("page2");
m_tab.InsertItem(0, &tc1);
m_tab.InsertItem(1, &tc2);
CRect rec;
m_tab.GetClientRect(&rec);
rec.bottom += 0;
rec.left -= 0;
rec.top += 20;
rec.right -= 0;
m_page1.Create(IDD_DIALOG1, GetDlgItem(IDC_TAB1));
m_page2.Create(IDD_DIALOG2, GetDlgItem(IDC_TAB1));
m_page1.MoveWindow(&rec);
m_page2.MoveWindow(&rec);
m_page1.ShowWindow(SW_SHOW);
m_page2.ShowWindow(SW_HIDE);
void Ctab3Dlg::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult)
{
switch (m_tab.GetCurSel())
{
case 0:
m_page1.ShowWindow(SW_SHOW);
m_page2.ShowWindow(SW_HIDE );
break;
case 1:
m_page1.ShowWindow(SW_HIDE);
m_page2.ShowWindow(SW_SHOW);
break;
default:
break;
}
*pResult = 0;
}