
Use CFormView as child of a Tab Control?
Use CFormView as child of a Tab Control?
Hi,
I am really stumped. I have a tab control being created as a child in a
view. I would like to display a child CFormView window (so I can use scroll
bars under the tabs to help display long dialogs). An example of this is the
right panel of the 3D Studio Max application.
Below is the code that has so far successfully created the tab control in
the window, but the CFormView child window is not showing up, though this
will compile without errors. Is the code, or approach wrong, or is there a
better way to achieve this?
Thanks for your help, I really should be working on issues beyond the user
interface at this point, so any advice will be really appreatiated.
Scott Kerr
Here is the code:
int CViewTools::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
RECT myRect;
myRect.bottom = 100;
myRect.left = 0;
myRect.right = 300;
myRect.top = 0;
m_ToolTab.Create( TCS_TABS | TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE,
myRect, this, 0x1006);
////////////////////////////////////////////////////////////////////////////
//////////////////////
// I had to make the CFormViewCeiling and ~CFormViewCeiling functions
public for this to work!
////////////////////////////////////////////////////////////////////////////
//////////////////////
CFormViewCeiling m_CFormViewCeiling;
if (!m_CFormViewCeiling.Create( _T("CFormViewCeiling"),
"Test",
WS_VISIBLE|WS_CHILD|WS_BORDER | WS_VSCROLL,
myRect,
this,
0x1009,
NULL)
)
{
TRACE0("Failed to Create m_CFormViewCeiling\n");
return -1;
}
m_CFormViewCeiling.ShowWindow(SW_SHOW);
m_CFormViewCeiling.BringWindowToTop();
return 0;
Quote:
}