15,978
社区成员
发帖
与我相关
我的任务
分享void CMyTab::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult) //单击选项卡后触发
{
int iNewTab = GetCurSel();
TCITEM item;
CWnd* pWnd;
item.mask = TCIF_PARAM;
//** show the selected tab --------
GetItem(iNewTab, &item);
pWnd = reinterpret_cast<CWnd*> (item.lParam);
ASSERT_VALID(pWnd);
if(m_bMove)
{
CRect rect;
pWnd->GetWindowRect(&rect);
ScreenToClient(&rect);//注意
m_wndwidth=rect.Width();
m_topleft=rect.TopLeft();
m_bottomright=rect.BottomRight();
m_topleft.x-=rect.Width();
m_bottomright.x-=rect.Width();
rect.SetRect(m_topleft,m_bottomright);
pWnd->MoveWindow(&rect,true);//将当前子窗体移到左边
pWnd->ShowWindow(SW_SHOW);
m_pCurWnd=pWnd;
SetTimer(1,10,NULL);//开始运动
}
else
pWnd->ShowWindow(SW_SHOW);
*pResult = 0;
}
void CMyTab::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult) //单击选项卡时触发
{
// TODO: Add your control notification handler code here
int iNewTab = GetCurSel();
TCITEM item;
CWnd* pWnd;
item.mask = TCIF_PARAM;
//** hide the current tab ---------
GetItem(iNewTab, &item);
pWnd = reinterpret_cast<CWnd*> (item.lParam);
ASSERT_VALID(pWnd);
pWnd->ShowWindow(SW_HIDE);
*pResult = 0;
}
