如何设置客户端窗口高 [英] how to set client window hight

查看:104
本文介绍了如何设置客户端窗口高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我增加父窗口,我想增加工具栏的高度.我使用CreatetoolbarEx函数创建工具栏.是否有任何示例代码.任何人都可以帮助我.

解决方案

您可以在OnSize中执行此操作.(只需一个伪代码)

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);


您必须照顾很多事情,例如
按钮图像大小(SetSizes()函数中的第二个参数).因为图像大小必须小于按钮大小(x上至少7个像素,y上至少6个像素).


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.

解决方案

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).


这篇关于如何设置客户端窗口高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆