Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to increse the hight of a tool bar if i increse the parent window.i create the toolbar using CreatetoolbarEx function.is there any sample code.any one help me.
Posted

1 solution

You can do like this in OnSize.(Just a pseudo code)
if(m_bSizeAvailable == TRUE)
{
    CRect tempRect;
    m_wndToolBar.GetItemRect(0,&tempRect);
    m_wndToolBar.SetSizes(CSize(tempRect.Width(),cy/10),CSize(16,15));
    m_wndToolBar.SetHeight(cy/10);
}
CFrameWnd::OnSize(nType, cx, cy);

you have to take care of lot of things like,
The button Image size (2nd parameter in SetSizes() function).Because if the images size must be less than the button size.(atleast 7 pixels on x and 6 pixels on y).
 
Share this answer
 
Comments
Himansu sekhar bal 28-Jun-11 3:32am    
this is not ctoolbar.that is the problem
I think you can simulate the above toolbar functions by sending the messages like,TB_GETRECT,TB_SETBUTTONWIDTH,TB_SETMETRICS to toolbar hwnd.But i never tried in win32

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900