Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - why does my CXTPTabControl can't handle message?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

why does my CXTPTabControl can't handle message?

 Post Reply Post Reply
Author
Message
iamthewind View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: China
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote iamthewind Quote  Post ReplyReply Direct Link To This Post Topic: why does my CXTPTabControl can't handle message?
    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
}
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2007 at 2:00am
Hi, 
Guess you subclass some static (IDC_TAB1) to TabControl.
If so just set Notify option to true.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
iamthewind View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: China
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote iamthewind Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2007 at 2:26am

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.
 
Back to Top
iamthewind View Drop Down
Newbie
Newbie


Joined: 11 September 2007
Location: China
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote iamthewind Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2007 at 3:34am

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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2007 at 4:23am
right.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.