Xtreme Toolkit Pro是MFC开发中最全面界面控件套包,它提供了Windows开发所需要的11种主流的Visual C++ MFC控件,包括Command Bars、Controls、Chart Pro、Calendar、Docking Pane、Property Grid、Report Control、Shortcut Bar、Syntax Edit、Skin Framework 和Task Panel。如果对产品感兴趣的话欢迎下载Xtreme Toolkit Pro最新试用版! 点击获取更多免费Xtreme Toolkit Pro教程、视频、示例!
【同类产品推荐】
- BCGControlBar for .NET | 下载试用 :包含有大量高度自定义、完全可设计的.NET界面控件,用户可以使用这些来创建精致美观的图形用户界面。
关于停靠工具栏有很多文章。但是,我觉得在Microsoft的MSDN站点上找到相同的信息这很重要简而言之…

将以下方法添加到您的CMainFrame类中:
void CMainFrame::DockControlBarLeftOf( CToolBar* Bar, CToolBar* LeftOf){ CRect rect; DWORD dw; UINT n; // get MFC to adjust the dimensions of all docked ToolBars // so that GetWindowRect will be accurate RecalcLayout(TRUE); LeftOf->GetWindowRect(&rect); rect.OffsetRect(1,0); dw=LeftOf->GetBarStyle(); n = 0; n = (dw&CBRS_ALIGN_TOP) AFX_IDW_DOCKBAR_TOP : n; n = (dw&CBRS_ALIGN_BOTTOM && n==0) AFX_IDW_DOCKBAR_BOTTOM : n; n = (dw&CBRS_ALIGN_LEFT && n==0) AFX_IDW_DOCKBAR_LEFT : n; n = (dw&CBRS_ALIGN_RIGHT && n==0) AFX_IDW_DOCKBAR_RIGHT : n; // When we take the default parameters on rect, DockControlBar // will dock each Toolbar on a seperate line. By calculating a // rectangle, we are simulating a Toolbar being dragged to that // location and docked. DockControlBar(Bar,n,&rect);}
现在,在您的CMainFrame :: OnCreate中,而不是使用DockControlBar,请使用DockControlBarLeftOf:
m_wndToolBar1.EnableDocking(CBRS_ALIGN_ANY);m_wndToolBar2.EnableDocking(CBRS_ALIGN_ANY);EnableDocking(CBRS_ALIGN_ANY);DockControlBar(&m_wndToolBar1);DockControlBarLeftOf(&m_wndToolBar2,&m_wndToolBar1);
这将停靠m_wndToolBar1左侧的m_wndToolBar2。点击获取文章对应示例Demo。
今天的内容就是这些了,下载最新版Xtreme ToolKit Pro并在下方评论区分享您对该产品的想法。您的反馈意见可帮助我们在以后的更新中找到正确的方向,作为Codejock的正版代理商现Xtreme ToolKit Pro正版授权最高立减2000元!
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!