|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Yusuf Abdulkadir
|
Jun 22, 2006 - 7:29 AM
|
Hello, I have an MDI application. My view class is derived from CFormView. I would like to embed a tab control / container in my view class and create multiple tabbed views from there. I looked into your existing examples and I did not find any. Do you have such example readily available? How do I go about adding a tab control / container to my CFormView class?
Thanks you in advance.
|
|
Technical Support
|
Jun 22, 2006 - 11:34 AM
|
If you have the CFormView class, then you should have some dialog resource as well, which means you can put a tab page container control onto it. You can see how it is done in the ProfUIS_Controls sample (the Tab Containers page).
|
|
Yusuf Abdulkadir
|
Jun 26, 2006 - 7:33 AM
|
Following the exmaple in the ProfUIS_Controls sample, I added class CMyTabPageContainerWndFlat : public CExtTabPageContainerFlatWnd into my view class which is derived from CFormView. Then OnCreate I have this code
m_wndTabPageContainerFlat.Create(this, CRect( 0, 0, 0, 0 ), ID_TABCTRL);
HICON hIcon = (HICON)::LoadImage( AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, 0 );
if( !m_wndColorCtrl0.Create( _T("BUTTON"), _T(""), WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), &m_wndTabPageContainerFlat, UINT(IDC_STATIC))) { TRACE0("Failed to create m_wndColorCtrl0\n"); return -1; // fail to create }
InitEditCtrl(&m_wndEditCtrl0, &m_wndTabPageContainerFlat); VERIFY( m_wndTabPageContainerFlat.PageInsert( &m_wndColorCtrl0, _T("ColorCtrl"), hIcon ) );
I don’t see any tabs created. Am I missing something? Following your exmaple code, what do I need to add to show the tab control with two tabs, one of that of the color tab and the second of that of the edit controls tab.
thanks,
|
|
Technical Support
|
Jun 26, 2006 - 1:33 PM
|
The problem is in the following line: m_wndTabPageContainerFlat.Create(this, CRect( 0, 0, 0, 0 ), ID_TABCTRL); You need to specify some real coordinates of the window instead of zeroes.
|
|