zoukankan      html  css  js  c++  java
  • 多窗口

    BOOL CMyDlg::OnInitDialog()
    {
    CDialog::OnInitDialog();

    ......

    InitChildWindows();

    return TRUE;  // return TRUE  unless you set the focus to a control

    }

    void CMyDlg::InitChildWindows()
    {
    CRect rc,childrec;
    CWnd* pItem = GetDlgItem(IDC_Groupbox);

    pItem->GetWindowRect(&rc); //获得IDC_Groupbox控件的rect大小

    //初始化窗口1
    m_DlgLogin.Create(IDD_DIALOG1,pItem);
    m_DlgLogin.GetWindowRect(&childrec);
    m_DlgLogin.SetWindowPos(GetParent(),2,8,
    (childrec.right-childrec.left), (childrec.bottom-childrec.top),0);
    m_DlgLogin.ShowWindow(SW_HIDE);

    }

    void CMenuDlg::ShowHideWindows(int iNdex)
    {
    m_commudlg.ShowWindow(SW_HIDE); //ID 1
    //m_DlgInput.ShowWindow(SW_HIDE); //id 2
    //.........

    switch (iNdex)
    {
    case 1:
    m_commudlg.ShowWindow(SW_SHOW);
    break;
    case 2:
    //m_DlgInput.ShowWindow(SW_SHOW);
    break;

    }

    }

    void CMenuDlg::OnBnClickedCommu()
    {
    // TODO: 在此添加控件通知处理程序代码
    this->ShowHideWindows(1);
    }

    VS2013

    外观:Border--(细)Thin

             Style  --(子类)Child

             System Menu --False

             Title Bar -- False

  • 相关阅读:
    p2394 精度题
    线性筛素数
    poj3468 线段树的懒惰标记
    逆元
    2018 Multi-University Training Contest 2
    2018 Multi-University Training Contest 1
    判断素数遇到的问题
    Mergeable Stack(链表实现栈)
    组合数
    poj2594 机器人寻找宝藏(最小路径覆盖)
  • 原文地址:https://www.cnblogs.com/thunder-wu/p/6145916.html
Copyright © 2011-2022 走看看