?? subject_60383.htm
字號:
<p>
序號:60383 發表者:夏雨天 發表日期:2003-11-13 10:15:37
<br>主題:請問大俠!怎么樣使一條工具條不要是一行顯示,而是多行多列顯示呀!
<br>內容:工具條總是在一行上比如:1 2 3 4 5<BR>但是我想使我的工具條變成:1 2<BR> 3 4 <BR> 5 6<BR>的樣子,請問怎么辦呀!
<br><a href="javascript:history.go(-1)">返回上頁</a><br><a href=http://www.copathway.com/cndevforum/>訪問論壇</a></p>
<hr size=1>
<blockquote><p>
回復者:dongls 回復日期:2003-11-13 10:38:48
<br>內容:void CToolBarEx::SetColumns()<BR>{<BR> int nCount = GetToolBarCtrl().GetButtonCount();<BR><BR> for(int i = 0; i < nCount; i++)<BR> {<BR> UINT nStyle = GetButtonStyle(i);<BR><BR> if(nStyle & TBBS_SEPARATOR)<BR> nStyle |= TBBS_WRAPPED;<BR> else<BR> nStyle &= ~TBBS_WRAPPED;<BR> <BR> SetButtonStyle(i, nStyle);<BR> }<BR><BR> Invalidate();<BR> GetParentFrame()->RecalcLayout();<BR>}<BR><BR>在換行的兩個按鈕中間用SEPARATOR分開
<br>
<a href="javascript:history.go(-1)">返回上頁</a><br><a href=http://www.copathway.com/cndevforum/>訪問論壇</a></p></blockquote>
<hr size=1>
<blockquote><p>
回復者:夏雨天 回復日期:2003-11-13 11:00:53
<br>內容:dongls你是為工具條單獨建立了類來管理的嗎?<BR>可是我是在CMainFrame對工具條來控制,有辦發嗎?<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>
回復者:夏雨天 回復日期:2003-11-13 11:18:43
<br>內容:原諒我水平很差!我在機器上試了不行呀!<BR>我在CMainFrame里控制的!<BR>我暫時把工具條定為6個按鈕,代碼如下:<BR> int nCount = 6;<BR> for(int i = 0; i < nCount; i++)<BR> {<BR> //UINT nStyle = GetButtonStyle(i);<BR> UINT nStyle = m_pMyToolBar->GetButtonStyle(i);<BR> if(nStyle & TBBS_SEPARATOR)<BR> nStyle |= TBBS_WRAPPED;<BR> else<BR> nStyle &= ~TBBS_WRAPPED;<BR> <BR> m_pMyToolBar->SetButtonStyle(i, nStyle);<BR> }<BR> m_pMyToolBar->SetButtonInfo(1,0,TBBS_SEPARATOR,1);<BR> Invalidate();<BR> //GetParentFrame()->RecalcLayout();<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>
<font color=red>答案被接受</font><br>回復者:dongls 回復日期:2003-11-13 23:10:09
<br>內容:假定有工具條m_wndToolBar;在CMainFrame里控制<BR><BR> int nCount = m_wndToolBar.GetToolBarCtrl().GetButtonCount();<BR><BR> for(int i = 0; i < nCount; i++)<BR> {<BR> UINT nStyle = m_wndToolBar.GetButtonStyle(i);<BR><BR> if(nStyle & TBBS_SEPARATOR)<BR> nStyle |= TBBS_WRAPPED;<BR> else<BR> nStyle &= ~TBBS_WRAPPED;<BR> <BR> m_wndToolBar.SetButtonStyle(i, nStyle);<BR> }<BR><BR> m_wndToolBar.Invalidate();<BR> RecalcLayout(); <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>
回復者:夏雨天 回復日期:2003-11-14 12:20:20
<br>內容:dongls 幫我看看把,我新建了一個工具條叫m_wndTestToolBar有6個按鈕,我想把它分成3個一行的形式,可是不行呀它怎么都不分行,我是在CMainFrame::OnCreate()里加的代碼,無奈呀。我的代碼如下:<BR> m_wndTestToolBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_TOP, IDR_TOOLBAR_1); <BR> m_wndTestToolBar.LoadBitmap(IDR_TOOLBAR_1); <BR> m_wndTestToolBar.SetButtons(My_Buttons, sizeof(My_Buttons)/sizeof(UINT)); <BR><BR> m_wndTestToolBar.EnableDocking(CBRS_ALIGN_ANY);<BR> EnableDocking(CBRS_ALIGN_ANY);<BR> DockControlBar(&m_wndTestToolBar);<BR><BR> int m_nColumns=3;//列數<BR><BR> int nCount=6;//按鈕數<BR><BR> for(int i=0;i<nCount;i++){<BR><BR> //UINT nStyle=GetButtonStyle(i);<BR> UINT nStyle = m_wndTestToolBar.GetButtonStyle(i);<BR><BR> BOOL bWrap=(((i+1)%m_nColumns)==0);<BR><BR> if(bWrap) nStyle|=TBBS_WRAPPED;<BR><BR> else nStyle&=~TBBS_WRAPPED;<BR><BR> m_wndTestToolBar.SetButtonStyle(i,nStyle);<BR> }<BR> m_wndTestToolBar.Invalidate();<BR><BR> RecalcLayout();<BR>dongls幫我看看哪里不對呀!郁悶呀!<BR><BR>2003-11-14 14:32:22
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -