Partager via


CPaneDialog::Create

Creates a docking dialog box and attaches it to a CPaneDialog object.

BOOL Create(
   LPCTSTR lpszWindowName,
   CWnd* pParentWnd,
   BOOL bHasGripper,
   LPCTSTR lpszTemplateName,
   UINT nStyle,
   UINT nID,
   DWORD dwTabbedStyle= AFX_CBRS_REGULAR_TABS,
   DWORD dwControlBarStyle=AFX_DEFAULT_DOCKING_PANE_STYLE
);
BOOL Create(
   LPCTSTR lpszWindowName,
   CWnd* pParentWnd,
   BOOL bHasGripper,
   UINT nIDTemplate,
   UINT nStyle,
   UINT nID 
);
BOOL Create(
   CWnd* pParentWnd,
   LPCTSTR lpszTemplateName,
   UINT nStyle,
   UINT nID 
);
BOOL Create(
   CWnd* pParentWnd,
   UINT nIDTemplate,
   UINT nStyle,
   UINT nID 
);

Parameters

  • [in] lpszWindowName
    The name of the docking dialog box.

  • [in] pParentWnd
    Points to the parent window.

  • [in] bHasGripper
    TRUE to create the docking dialog box with a caption (gripper); otherwise, FALSE.

  • [in] lpszTemplateName
    The name of the resource dialog template.

  • [in] nStyle
    The Windows style.

  • [in] nID
    The control ID.

  • [in] nIDTemplate
    The resource ID of the dialog template.

  • [in] dwTabbedStyle
    The style of the tabbed window that results when the user drags another control pane onto the caption of this control pane. The default value is AFX_CBRS_REGULAR_TABS. For more information, see the Remarks section of the CBasePane::CreateEx method.

  • [in] dwControlBarStyle
    Additional style attributes. The default value is AFX_DEFAULT_DOCKING_PANE_STYLE. For more information, see the Remarks section of the CBasePane::CreateEx method.

Return Value

TRUE if this method succeeds; otherwise, FALSE.

Example

The following example demonstrates how to use the Create method in the CPaneDialog class. This example is part of the Set Pane Size sample.

 CPaneDialog     m_wndDlgBar;


...


    // The this pointer points to a CMainFrame class which extends the CFrameWnd class. 
    if (!m_wndDlgBar.Create (_T("DialogBar"), this, TRUE, 
                             MAKEINTRESOURCE (IDD_DLG_BAR), 
                             WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI, 
                             ID_VIEW_DLGBAR))
    {
        TRACE0("Failed to create Dialog Bar\n");
        return FALSE;      // fail to create
    }

Requirements

Header: afxpanedialog.h

See Also

Reference

CPaneDialog Class

Hierarchy Chart