📄 subject_17683.htm
字号:
<p>
序号:17683 发表者:hufeifei 发表日期:2002-10-14 16:01:20
<br>主题:多个浮动工具栏停靠时,怎么样才能一行停靠多个工具栏,而不是一个工具条占一行?
<br>内容:多个浮动工具栏在系统开始时停靠在菜单下面,总是一个工具条占一行,怎么样才能一行停靠多个工具栏?<BR> DockControlBar(&m_wndToolBar, AFX_IDW_DOCKBAR_TOP);<BR>这种方法始终是一个工具栏占一行<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:徐景周 回复日期:2002-10-14 16:14:30
<br>内容:在OnCreate中调用下面涵数既可。<BR><BR>用法如下:<BR> DockControlBar(&m_wndToolBarMain);<BR> DockControlBarLeftOf( &m_wndToolBarOperate, &m_wndToolBarMain );<BR><BR>把wndToolBarOperate工具条停靠在wndToolBarMain 工具条瓣右边。<BR><BR>// ---------------------------------------------------------<BR>// 名称:DockControBarLeftOf<BR>//<BR>// 功能:停靠Toolbar函数<BR>//<BR>// 变量:Bar----用于停靠的Toolbar<BR>// LeftOf----已停靠的左侧Toolbar<BR>// 返回:无<BR>//<BR>// 编写: jingzhou xu<BR>// 编写日期:2002.04.30<BR>// ---------------------------------------------------------<BR>void CMainFrame::DockControlBarLeftOf(CControlBar* Bar, CControlBar* LeftOf)<BR>{<BR> CRect rect;<BR> DWORD dw;<BR> UINT n;<BR> <BR> // get MFC to adjust the dimensions of all docked ToolBars<BR> // so that GetWindowRect will be accurate<BR> RecalcLayout(TRUE);<BR> <BR> LeftOf->GetWindowRect(&rect);<BR> rect.OffsetRect(1,0);<BR> dw=LeftOf->GetBarStyle();<BR> n = 0;<BR> n = (dw&CBRS_ALIGN_TOP) ? AFX_IDW_DOCKBAR_TOP : n;<BR> n = (dw&CBRS_ALIGN_BOTTOM && n==0) ? AFX_IDW_DOCKBAR_BOTTOM : n;<BR> n = (dw&CBRS_ALIGN_LEFT && n==0) ? AFX_IDW_DOCKBAR_LEFT : n;<BR> n = (dw&CBRS_ALIGN_RIGHT && n==0) ? AFX_IDW_DOCKBAR_RIGHT : n;<BR> <BR> // When we take the default parameters on rect, DockControlBar will dock<BR> // each Toolbar on a seperate line. By calculating a rectangle, we in effect<BR> // are simulating a Toolbar being dragged to that location and docked.<BR> DockControlBar(Bar,n,&rect);<BR>}<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:hufeifei 回复日期:2002-10-17 11:32:41
<br>内容:太感谢了!很不错啊!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -