Print Page | Close Window

why does my CXTPTabControl can't handle message?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8521
Printed Date: 13 July 2025 at 10:58pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: why does my CXTPTabControl can't handle message?
Posted By: iamthewind
Subject: why does my CXTPTabControl can't handle message?
Date 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
}



Replies:
Posted By: Oleg
Date 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


Posted By: iamthewind
Date 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.
 


Posted By: iamthewind
Date 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


Posted By: Oleg
Date Posted: 25 October 2007 at 4:23am
right.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net