Can't Undock my CDialogBar
-
I can't seem to undock my CDialogBar. It creates the dialog bar, and docks it to the left side of my main frame, but I can't drag it away. I'm not quite sure what's wrong. Any ideas? Here's my code:
//////// My DialogBar Class Declaration class CDlgTree : public CDialogBar { DECLARE_DYNAMIC(CDlgTree) public: CDlgTree(CWnd* pParent = NULL); // standard constructor virtual ~CDlgTree(); // Dialog Data enum { IDD = IDD_DLGTREEBAR }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() }; /////////////////////////////////////////////////////////////////////// // The creation in my CMainFrm class in OnCreate /////////////////////////////////////////////////////////////////////// // TreeDlg if (!m_treeBar.Create(this, IDD_DLGTREEBAR, CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT | CBRS_GRIPPER, AFX_IDW_CONTROLBAR_LAST - 1)) { TRACE0("Failed to create TreeBar\n"); return -1; } m_treeBar.SetWindowText("Components"); m_treeBar.EnableDocking(CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT);
Thanks :-D -
I can't seem to undock my CDialogBar. It creates the dialog bar, and docks it to the left side of my main frame, but I can't drag it away. I'm not quite sure what's wrong. Any ideas? Here's my code:
//////// My DialogBar Class Declaration class CDlgTree : public CDialogBar { DECLARE_DYNAMIC(CDlgTree) public: CDlgTree(CWnd* pParent = NULL); // standard constructor virtual ~CDlgTree(); // Dialog Data enum { IDD = IDD_DLGTREEBAR }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() }; /////////////////////////////////////////////////////////////////////// // The creation in my CMainFrm class in OnCreate /////////////////////////////////////////////////////////////////////// // TreeDlg if (!m_treeBar.Create(this, IDD_DLGTREEBAR, CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT | CBRS_GRIPPER, AFX_IDW_CONTROLBAR_LAST - 1)) { TRACE0("Failed to create TreeBar\n"); return -1; } m_treeBar.SetWindowText("Components"); m_treeBar.EnableDocking(CBRS_ALIGN_RIGHT | CBRS_ALIGN_LEFT);
Thanks :-DNTense wrote: class CDlgTree : public CDialogBar Not sure if this is related to your problem or not, but it might be. Check this MSDN article[^] Note this: While it is normal to derive your own dialog classes from CDialog, you do not typically derive your own class for a dialog bar. Dialog bars are extensions to a main window and any dialog-bar control-notification messages, such as BN_CLICKED or EN_CHANGE, will be sent to the parent of the dialog bar — the main window. -- jlr http://jlamas.blogspot.com/[^]