
Use CFormView as child of a Tab Control?
Hi Scott,
I wonder if you have set the dialog ID using the following overload of
CXXFormView?
CFormView::CFormView(UINT nIDTemplate)
In addition, make sure m_CFormViewCeiling is declared at the class level. I
also overloaded the create method, and it works properly then.
You can also use frame-view architect, and create the view in the frame.
The following article may help:
http://www.*-*-*.com/ ++/c++1298.htm
Note: The CMySplitterWnd::ChangeView function in MySplit.cpp file may be
what you need.
Hope this helps.
Best Regards,
Leo Chen
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Newsgroups: microsoft.public.vc.mfc
| Subject: Use CFormView as child of a Tab Control?
| Lines: 74
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Date: Sat, 26 Oct 2002 06:57:27 GMT
| NNTP-Posting-Host: 141.153.137.40
| X-Trace: nwrddc01.gnilink.net 1035615447 141.153.137.40 (Sat, 26 Oct 2002
02:57:27 EDT)
| NNTP-Posting-Date: Sat, 26 Oct 2002 02:57:27 EDT
| Path:
cpmsftngxa09!cpmsftngxa10!tkmsftngp01!newsfeed00.sul.t-online.de!t-online.de
!news.stealth.net!news.stealth.net!news-out.nuthinbutnews.com!propagator2-st
erling!news-in-sterling.newsfeed.com!news-in.nuthinbutnews.com!cyclone1.gnil
ink.net!spamfinder.gnilink.net!nwrddc01.gnilink.net.POSTED!53ab2750!not-for-
mail
| Xref: cpmsftngxa09 microsoft.public.vc.mfc:352872
| X-Tomcat-NG: microsoft.public.vc.mfc
|
| 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;
|
| }
|
|
|
|