The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CFormView Class


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at CFormView Class.

The base class used for form views.

class CFormView : public CScrollView  

Protected Constructors

CFormView::CFormViewConstructs a CFormView object.

Public Methods

CFormView::IsInitDlgCompletedUsed for synchronization during initialization.

A form view is essentially a view that contains controls. These controls are laid out based on a dialog-template resource. Use CFormView if you want forms in your application. These views support scrolling, as needed, using the CScrollView functionality.

When you are Creating a Forms-Based Application, you can base its view class on CFormView, making it a forms-based application.

You can also insert new Form Topics into document-view-based applications. Even if your application did not initially support forms, Visual C++ will add this support when you insert a new form.

The MFC Application Wizard and the Add Class command are the preferred methods for creating forms-based applications. If you need to create a forms-based application without using these methods, see Creating a Forms-Based Application.







Header: afxext.h

Constructs a CFormView object.

CFormView(LPCTSTR lpszTemplateName);  
CFormView(UINT nIDTemplate);
### Parameters  
 Contains a null-terminated string that is the name of a dialog-template resource.  
 Contains the ID number of a dialog-template resource.  
### Remarks  
 When you create an object of a type derived from `CFormView`, invoke one of the constructors to create the view object and identify the dialog resource on which the view is based. You can identify the resource either by name (pass a string as the argument to the constructor) or by its ID (pass an unsigned integer as the argument).  
 The form-view window and child controls are not created until `CWnd::Create` is called. `CWnd::Create` is called by the framework as part of the document and view creation process, which is driven by the document template.  
> [!NOTE]
>  Your derived class *must* supply its own constructor. In the constructor, invoke the constructor, `CFormView::CFormView`, with the resource name or ID as an argument as shown in the preceding class overview.  
### Example  
 [!CODE [NVC_MFCDocView#90](../CodeSnippet/VS_Snippets_Cpp/NVC_MFCDocView#90)]  
 [!CODE [NVC_MFCDocView#91](../CodeSnippet/VS_Snippets_Cpp/NVC_MFCDocView#91)]  
##  <a name="cformview__isinitdlgcompleted"></a>  CFormView::IsInitDlgCompleted  
 Used by MFC to ensure that initialization is completed before performing other operations.  

BOOL IsInitDlgCompleted() const;

### Return Value  
 True if the initialization function for this dialog has completed.  
## See Also  
 [MFC Sample SNAPVW](../Topic/   
 [MFC Sample VIEWEX](../Topic/   
 [CScrollView Class](../Topic/   
 [Hierarchy Chart](../Topic/   
 [CDialog Class](../Topic/   
 [CScrollView Class](../Topic/