zoukankan      html  css  js  c++  java
  • 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);
    }
    发现自己的不足,善于利用找到的方法去扬长避短。行动起来。
  • 相关阅读:
    Bash 小问题【待更新】
    进程动态优先级调度
    密码
    [Noi2016]优秀的拆分
    [Tjoi2016&Heoi2016]字符串
    [BZOJ 1901]Dynamic Rankings
    [HDU 2665]Kth number
    [BZOJ 4310]跳蚤
    [Sdoi2008]Sandy的卡片
    [Usaco2007 Dec]队列变换
  • 原文地址:https://www.cnblogs.com/rechen/p/5075181.html
Copyright © 2011-2022 走看看