Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CDockablePane without Close button

CDockablePane without Close button

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VCsamir
    wrote on last edited by
    #1

    hi all, I want to remove the 'X' close button from the DockablePane. But i want the Autohide button to be there .. Is there any way to do it?? Thanks in Advance Regards Samir Satardekar

    L 1 Reply Last reply
    0
    • V VCsamir

      hi all, I want to remove the 'X' close button from the DockablePane. But i want the Autohide button to be there .. Is there any way to do it?? Thanks in Advance Regards Samir Satardekar

      L Offline
      L Offline
      laiboy
      wrote on last edited by
      #2

      That is easy! There has two space to do this. For example, you derive a class CFileViewWnd from CDockablePane. Create an instance. CFileViewWnd m_wndFileView; 1. When you create the pane.use this. The default create method is virtual BOOL CreateEx(DWORD dwStyleEx, LPCTSTR lpszCaption, CWnd* pParentWnd, const RECT& rect, BOOL bHasGripper, UINT nID, DWORD dwStyle, DWORD dwTabbedStyle = AFX_CBRS_REGULAR_TABS, DWORD dwControlBarStyle = AFX_DEFAULT_DOCKING_PANE_STYLE, CCreateContext* pContext = NULL); the AFX_DEFAULT_DOCKING_PANE_STYLE defined is static const DWORD AFX_DEFAULT_DOCKING_PANE_STYLE = AFX_CBRS_FLOAT | AFX_CBRS_CLOSE | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE; So, you can remove the create flags "AFX_CBRS_CLOSE" like this. m_wndFileView.Create( strFileViewWnd, this, CRect( 0, 0, 200, 200 ), TRUE, ID_PANE_FILEVIEW_WND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI, AFX_CBRS_REGULAR_TABS, AFX_CBRS_FLOAT | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE ) ) It's OK! 2. Use the method GetControlBarStyle() and SetControlBarStyle( dwStyle ) DWORD dwStyle = m_wndFileView.GetControlBarStyle(); dwStyle &= ~( AFX_CBRS_CLOSE | AFX_CBRS_FLOAT ); m_wndFileView.SetControlBarStyle( dwStyle ); It's OK ! Enjoy It ! http://blog.csdn.net/laiboy

      A 1 Reply Last reply
      0
      • L laiboy

        That is easy! There has two space to do this. For example, you derive a class CFileViewWnd from CDockablePane. Create an instance. CFileViewWnd m_wndFileView; 1. When you create the pane.use this. The default create method is virtual BOOL CreateEx(DWORD dwStyleEx, LPCTSTR lpszCaption, CWnd* pParentWnd, const RECT& rect, BOOL bHasGripper, UINT nID, DWORD dwStyle, DWORD dwTabbedStyle = AFX_CBRS_REGULAR_TABS, DWORD dwControlBarStyle = AFX_DEFAULT_DOCKING_PANE_STYLE, CCreateContext* pContext = NULL); the AFX_DEFAULT_DOCKING_PANE_STYLE defined is static const DWORD AFX_DEFAULT_DOCKING_PANE_STYLE = AFX_CBRS_FLOAT | AFX_CBRS_CLOSE | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE; So, you can remove the create flags "AFX_CBRS_CLOSE" like this. m_wndFileView.Create( strFileViewWnd, this, CRect( 0, 0, 200, 200 ), TRUE, ID_PANE_FILEVIEW_WND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI, AFX_CBRS_REGULAR_TABS, AFX_CBRS_FLOAT | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE ) ) It's OK! 2. Use the method GetControlBarStyle() and SetControlBarStyle( dwStyle ) DWORD dwStyle = m_wndFileView.GetControlBarStyle(); dwStyle &= ~( AFX_CBRS_CLOSE | AFX_CBRS_FLOAT ); m_wndFileView.SetControlBarStyle( dwStyle ); It's OK ! Enjoy It ! http://blog.csdn.net/laiboy

        A Offline
        A Offline
        Alexandre GRANVAUD
        wrote on last edited by
        #3

        works fine but when typing Alt+F4, the Pane closes if floating, how to avoid this ?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups