why does my CXTPTabControl can't handle message? |
Post Reply |
Author | |
iamthewind
Newbie Joined: 11 September 2007 Location: China Status: Offline Points: 22 |
Post Options
Thanks(0)
Posted: 25 October 2007 at 1:57am |
I create a simple MFC dialog application with a CXTPTabControl control, but this control can't click and handle any message, why? what should I do? Thanks! the code I wrote just as below:
// ToolkitTestDlg.h
class CToolkitTestDlg : public CDialog
{ ...
CXTPTabControl m_wndTabControl;
};
// ToolkitTestDlg.cpp
void CToolkitTestDlg::DoDataExchange(CDataExchange* pDX)
{ CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_TAB1, m_wndTabControl); } BOOL CToolkitTestDlg::OnInitDialog()
{ ....
UpdateData();
m_wndTabControl.GetPaintManager()->SetAppearance(xtpTabAppearanceStateButtons); m_wndTabControl.GetPaintManager()->m_bHotTracking = TRUE; m_wndTabControl.GetPaintManager()->m_bShowIcons = TRUE; m_wndTabControl.GetPaintManager()->m_bStaticFrame = TRUE; m_wndTabControl.GetPaintManager()->DisableLunaColors(FALSE); m_wndTabControl.InsertItem(0, _T("Recommand"));
m_wndTabControl.InsertItem(1, _T("Top")); m_wndTabControl.SetCurSel(1);
m_wndTabControl.EnableWindow(TRUE);
return TRUE; // return TRUE unless you set the focus to a control
} |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Guess you subclass some static (IDC_TAB1) to TabControl.
If so just set Notify option to true.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
iamthewind
Newbie Joined: 11 September 2007 Location: China Status: Offline Points: 22 |
Post Options
Thanks(0)
|
Thanks, but I am sorry I don't know how to subclass IDC_TAB1, I call
m_wndTabControl.SubclassDlgItem(IDC_TAB1, this);
in BOOL CToolkitTestDlg::OnInitDialog()
MFC will throw out a exception.
|
|
iamthewind
Newbie Joined: 11 September 2007 Location: China Status: Offline Points: 22 |
Post Options
Thanks(0)
|
faint, I know why. at first, I use Tab Control from Dialog edit.
CONTROL "",IDC_TAB1,"SysTabControl32",0x0,14,164,288,39
and SysTabControl32 can't set Notify options.
and now I replaced Tab Control with static control, it works.
at resource, static control descripted as :
CONTROL "",IDC_TAB1,"Static",SS_BLACKFRAME | SS_NOTIFY,17,15,279,135
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
right.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |