⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index133.htm

📁 关于vc的一本问题集,很不错的,有很多精采的问题
💻 HTM
字号:
<html>
<style type="text/css"><!--
.p9 {  font-family: "宋体"; font-size: 9pt}a        {text-transform: none; text-decoration: none;}
a:hover {text-decoration: underline; color: #FF0000;}
--></style>
<body background="../../../backg.jpg">
<h3 align="center"><font COLOR="#AOAO99"></font></h3>
<table width="100%" border="1" cellspacing="1">
<tr><td><p align="center"><font color="#FF0000">工具条状态的问题?</font></td></tr>
<tr><td><p>
</Br>
在应用程序中我创建了三个工具条,我想让它们在应用程序启动的时候排成一行正好在主菜单的下面,我该如何去做?<Br>
</Br>
在VC CDs上有一个例子:<Br>
</Br>
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)<Br>
{<Br>
//other stuff here...<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;EnableDocking(CBRS_ALIGN_ANY);<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP);<Br>
&nbsp;&nbsp;&nbsp;&nbsp;DockControlBarLeftOf(&m_wndListToolBar,&m_wndToolBar);<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;return 0;<Br>
}<Br>
</Br>
void CMainFrame::DockControlBarLeftOf(CToolBar* Bar,CToolBar* LeftOf)<Br>
{<Br>
&nbsp;&nbsp;&nbsp;&nbsp;CRect rect;<Br>
&nbsp;&nbsp;&nbsp;&nbsp;DWORD dw;<Br>
&nbsp;&nbsp;&nbsp;&nbsp;UINT n;<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;// get MFC to adjust the dimensions of all docked ToolBars<Br>
&nbsp;&nbsp;&nbsp;&nbsp;// so that GetWindowRect will be accurate<Br>
&nbsp;&nbsp;&nbsp;&nbsp;RecalcLayout();<Br>
&nbsp;&nbsp;&nbsp;&nbsp;LeftOf->GetWindowRect(&rect);<Br>
&nbsp;&nbsp;&nbsp;&nbsp;rect.OffsetRect(1,0);<Br>
&nbsp;&nbsp;&nbsp;&nbsp;dw=LeftOf->GetBarStyle();<Br>
&nbsp;&nbsp;&nbsp;&nbsp;n = 0;<Br>
&nbsp;&nbsp;&nbsp;&nbsp;n = (dw & CBRS_ALIGN_TOP)            ? AFX_IDW_DOCKBAR_TOP    :n;<Br>
&nbsp;&nbsp;&nbsp;&nbsp;n = (dw & CBRS_ALIGN_BOTTOM && n==0) ? AFX_IDW_DOCKBAR_BOTTOM :n;<Br>
&nbsp;&nbsp;&nbsp;&nbsp;n = (dw & CBRS_ALIGN_LEFT   && n==0) ? AFX_IDW_DOCKBAR_LEFT   :n;<Br>
&nbsp;&nbsp;&nbsp;&nbsp;n = (dw & CBRS_ALIGN_RIGHT  && n==0) ? AFX_IDW_DOCKBAR_RIGHT  :n;<Br>
</Br>
&nbsp;&nbsp;&nbsp;&nbsp;// When we take the default parameters on rect, DockControlBar will dock<Br>
&nbsp;&nbsp;&nbsp;&nbsp;// each Toolbar on a seperate line.  By calculating a rectangle, we in effect<Br>
&nbsp;&nbsp;&nbsp;&nbsp;// are simulating a Toolbar being dragged to that location and docked.<Br>
&nbsp;&nbsp;&nbsp;&nbsp;DockControlBar(Bar,n,&rect);<Br>
}<Br>
</Br>
</p></td></tr>
</table><p align="center"><img src="../../../logo.gif" align="center"><center><table><tr><td><a href="http://www.ourcode.net" target=_top>www.OurCode.net</a><Br>版权所有: 2002-2008</a></td></tr></table></center></p>
</body><SCRIPT LANGUAGE='JavaScript' SRC='../../../navigate_bar.js'></SCRIPT><SCRIPT LANGUAGE='JavaScript'>write_tail();</SCRIPT></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -