CFormView Class

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see CFormView Class on docs.microsoft.com. The base class used for form views.

class CFormView : public CScrollView  

Protected Constructors

NameDescription
CFormView::CFormViewConstructs a CFormView object.

Public Methods

NameDescription
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.

CObject

CCmdTarget

CWnd

CView

CScrollView

CFormView

Header: afxext.h

Constructs a CFormView object.

CFormView(LPCTSTR lpszTemplateName);  
CFormView(UINT nIDTemplate);
```  
  
### Parameters  
 `lpszTemplateName`  
 Contains a null-terminated string that is the name of a dialog-template resource.  
  
 `nIDTemplate`  
 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/Visual%20C++%20Samples.md)   
 [MFC Sample VIEWEX](../Topic/Visual%20C++%20Samples.md)   
 [CScrollView Class](../Topic/CScrollView%20Class.md)   
 [Hierarchy Chart](../Topic/Hierarchy%20Chart.md)   
 [CDialog Class](../Topic/CDialog%20Class.md)   
 [CScrollView Class](../Topic/CScrollView%20Class.md)







Show: