15,979
社区成员
发帖
与我相关
我的任务
分享
BOOL CDlgBaseInfoManage::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: 在此添加额外的初始化
//设置标签控件标题及对应显示的对话框
m_tab.AddPage(L"用户信息",&m_dlg_baseinfomanage_operator,IDD_BASEINFOMANAGE_OPERATOR);
if (nSelect >= 0)
{
m_tab.Show(nSelect);
}
else
{
m_tab.Show();
}
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
BOOL CTabSheet::AddPage(LPCTSTR title, CDialog *pDialog,UINT ID)
{
if( MAXPAGE == m_nNumOfPages )
return FALSE;
m_nNumOfPages++;
m_pPages[m_nNumOfPages-1] = pDialog;
m_IDD[m_nNumOfPages-1] = ID;
m_Title[m_nNumOfPages-1] = title;
return TRUE;
}
void CTabSheet::Show(int n)
{
for( int i=0; i < m_nNumOfPages; i++ )
{
m_pPages[i]->Create( m_IDD[i], this );
InsertItem( i, m_Title[i] );
}
for(int i=0; i < m_nNumOfPages; i++)
m_pPages[i]->ShowWindow(SW_HIDE);
m_pPages[n]->ShowWindow(SW_SHOW);
SetRect(n);
SetCurSel(n);
}
public:
CTabSheet m_tab;
void CDlgBaseInfoManage::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB, m_tab);
}