Click here to Skip to main content
15,851,902 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Posted
Updated 3-May-13 3:16am
v3
Comments
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!!!
[no name] 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)
{
CDialogEx::DoDataExchange(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)
ON_WM_CTLCOLOR()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()




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

m_OK.m_bOverControl = FALSE;
m_Cancel.m_bOverControl = FALSE;
m_OK.EnableHot();
m_Cancel.EnableHot();


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)
dwFlags |= ETC_SELECTION;

if (m_bGradient)
dwFlags |= ETC_GRADIENT;

if (m_bBackTabs)
dwFlags |= ETC_BACKTABS;

m_DiagnoseTabCtrl.SetBkgndColor(BKCOLOR);
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)

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900