CRect r; m_TabPermission.GetClientRect(&r); m_dlgSysManager.SetWindowPos(NULL,0,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW); m_dlgDeviceManager.SetWindowPos(NULL,0,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW); m_dlgOtherManager.SetWindowPos(NULL,0,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
m_Tab.SetExtendedStyle(dwStyle|TCS_VERTICAL|TCS_MULTILINE|TCS_RIGHT );
楼上的老兄,我这样设置了,怎么还不可以呢?
其实用不着写程序,在资源属性上设置就可以,主要是VERTICAL。
{
CDialog::OnInitDialog(); DWORD dwStyle = m_TabPermission.GetExStyle();
m_TabPermission.SetExtendedStyle(dwStyle|TCS_VERTICAL);
m_TabPermission.InsertItem(0,_T("系统管理"));
m_TabPermission.InsertItem(1,_T("设备管理"));
m_TabPermission.InsertItem(2,_T("其他")); m_dlgSysManager.Create(IDD_DLG_SYSMANAGER,&m_TabPermission);
m_dlgDeviceManager.Create(IDD_DLG_DEVICEMANAGER,&m_TabPermission);
m_dlgOtherManager.Create(IDD_DLG_OTHERMANAGER,&m_TabPermission);
CRect r;
m_TabPermission.GetClientRect(&r);
m_dlgSysManager.SetWindowPos(NULL,0,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW);
m_dlgDeviceManager.SetWindowPos(NULL,0,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW);
m_dlgOtherManager.SetWindowPos(NULL,0,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW); return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}