CTabView::AddView

Adds a view to the tab control.

int AddView(
   CRuntimeClass* pViewClass,
   const CString& strViewLabel,
   int iIndex=-1,
   CCreateContext* pContext=NULL 
);

Parameters

  • [in] pViewClass
    A pointer to a runtime class of the inserted view.

  • [in] strViewLabel
    Specifies the tab's text.

  • [in] iIndex
    Specifies the zero-based position at which to insert the view. If the position is -1 the new tab is inserted at the end.

  • [in] pContext
    A pointer to the CCreateContext of the view.

Return Value

A view index if this method succeeds. Otherwise, -1.

Remarks

Call this function to add a view to the tab control that is embedded in a frame.

Requirements

Header: afxTabView.h

See Also

Reference

CTabView Class

Hierarchy Chart