Click here to Skip to main content
13,904,336 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Everyone...

I need to add a Tab Control in my Dialog based MFC Application for which I am using MFC Tool Tab Control. For 1st Tab I have created a Child style window dialog on which I have added a Custom control tool and 2 Buttons. Also I have changed the background color. But when I run the application neither the custom tool and buttons are visible nor the background color changed.

Where am I going wrong?

Please help me out.
Updated 3-May-13 2:16am
Fresher16 3-May-13 3:27am
Properties of Tab Control are as follows:
Transparent: TRUE.
Visible: TRUE.
Multiline: TRUE.
Owner Draw Fixed: TRUE
Coder Block 3-May-13 3:32am
need code!!!
NotPolitcallyCorrect 3-May-13 8:11am
No... it's not urgent at all. If it were urgent you would have posted the code as you was asked to so someone could see where it was that you went wrong.
Fresher16 3-May-13 23:51pm
void CDiagnostics::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_DIAGNOSETABS, m_DiagnoseTabCtrl);

BEGIN_MESSAGE_MAP(CDiagnostics, CDialogEx)
ON_BN_CLICKED(IDOK, &CDiagnostics::OnBnClickedOk)
ON_BN_CLICKED(IDCANCEL, &CDiagnostics::OnBnClickedCancel)

BOOL CDiagnostics::OnInitDialog()
SetBackgroundColor (g_DlgColor);

m_OK.m_bOverControl = FALSE;
m_Cancel.m_bOverControl = FALSE;

m_pPrintHeadProfile = new CPrintHeadProfile;
m_pPrintHeadProfile->Create(CPrintHeadProfile::IDD, &m_DiagnoseTabCtrl);
m_DiagnoseTabCtrl.AddTab(m_pPrintHeadProfile, "Print Head Profile", 0);
m_pPrintHeadProfile->m_pTabCtrl = &m_DiagnoseTabCtrl;

m_colorval = RGB(210,230,255);//RGB(122, 204, 200);
m_bkcolorval = RGB(122, 204, 200);//RGB(122, 204, 200);
DWORD dwFlags = 0;

if (m_bFlat)
dwFlags |= ETC_FLAT;

if (m_bColor)
dwFlags |= ETC_COLOR;

if (m_bSelection)

if (m_bGradient)
dwFlags |= ETC_GRADIENT;

if (m_bBackTabs)
dwFlags |= ETC_BACKTABS;

m_DiagnoseTabCtrl.EnableDraw(m_bFlat ? BTC_ALL : dwFlags ? BTC_TABS : BTC_NONE);

CConfigTabCtrl::EnableCustomLook(dwFlags | m_bBackColor, dwFlags);
Fresher16 3-May-13 23:53pm
Here, CPrintHeadProfile class is associated with the Dialog (Style: Child)
Fresher16 3-May-13 23:55pm
Coder Block and ThePhantomUpvoter please have a look on the code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190306.1 | Last Updated 3 May 2013
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100