📄 index133.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="../di2001.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>
EnableDocking(CBRS_ALIGN_ANY);<Br>
</Br>
DockControlBar(&m_wndToolBar,AFX_IDW_DOCKBAR_TOP);<Br>
DockControlBarLeftOf(&m_wndListToolBar,&m_wndToolBar);<Br>
</Br>
return 0;<Br>
}<Br>
</Br>
void CMainFrame::DockControlBarLeftOf(CToolBar* Bar,CToolBar* 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();<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>
</p></td></tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -