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



    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);
    }
    发现自己的不足,善于利用找到的方法去扬长避短。行动起来。
  • 相关阅读:
    25 Groovy 相关资料
    24 使用Maven 或 Gradle构建groovy
    UVA
    UVA
    UVA
    UVA
    UVA
    【JZOJ4235】序列【数论,数学】
    【JZOJ4235】序列【数论,数学】
    【JZOJ5230】队伍统计【状压DP】
  • 原文地址:https://www.cnblogs.com/rechen/p/5075181.html
Copyright © 2020-2023  润新知