首页 > Windows开发 > 详细

vc 使用SetWindowPos改变窗体的大小,实现折叠,展开

时间:2015-12-25 11:23:33      阅读:253      评论:0      收藏:0      [点我收藏+]

void
CWork::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); SetWindowPos(NULL,0,0,900,460,SWP_NOMOVE | SWP_NOZORDER);

上面是初始化窗体的大小。

增加事件响应来 实现窗体的折叠,展开(改变大小)

//折叠窗体
void CWork::Onkuozhan() 
{
    // TODO: Add your control notification handler code here
//     CRect rect;
//     GetClientRect(&rect);//得到客户端矩形
//     MoveWindow(rect.Width()/3,rect.Height()/3,rect.Width(),rect.Height()/1.5);//移动窗口
    SetWindowPos(NULL,0,0,900,460,SWP_NOMOVE | SWP_NOZORDER);

    //CMenu *pMenu=GetMenu();//获取菜单栏主菜单
    //CMenu *pTestMenu=pMenu->GetSubMenu(1);//获取子菜单
}
//展开窗体
void CWork::Onhuanyuan() 
{
    // TODO: Add your control notification handler code here
    SetWindowPos(NULL,0,0,900,730,SWP_NOMOVE | SWP_NOZORDER);
}

 

vc 使用SetWindowPos改变窗体的大小,实现折叠,展开

原文:http://www.cnblogs.com/rechen/p/5075181.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!