Re: How to reduce toolbar's height.
"umeca74" <[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
--- In [email protected], "xuqinjie" <qinjiexu@...> wrote: > > It seems that the WTL toolbar is a little higher than normal. I donft want to use CommandBar or rebar, how to reduce the height of toolbar? > here's one way to do it: 1. create toolbar with default ATL_SIMPLE_TOOLBAR_STYLE (autosizing) 2. Get the optimal toolbar size and reduce it a little; turn off autosizing: m_tb.ModifyStyle(TBSTYLE_TRANSPARENT, TBSTYLE_FLAT); m_tb.SendMessage(WM_SIZE, 0, 0); CRect rectTB; m_tb.GetWindowRect(&rectTB); m_cxyHeader = rectTB.bottom - rectTB.top - 3; m_tb.ModifyStyle(0, CCS_NORESIZE); 3. Now manually size the toolbar in UpdateLayout(): RECT rect = {0, 0, cxWidth, m_cxyHeader}; m_tb.SetWindowPos(NULL, &rect, SWP_NOZORDER | SWP_NOACTIVATE); hth nikos ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/