⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgmain.cpp

📁 一个器材管理系统界面
💻 CPP
字号:
// dlgMain.cpp : implementation file
//

#include "stdafx.h"
#include "EquipManage2.h"
#include "dlgMain.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// dlgMain dialog


dlgMain::dlgMain(CWnd* pParent /*=NULL*/)
	: CDialog(dlgMain::IDD, pParent)
{
	//{{AFX_DATA_INIT(dlgMain)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void dlgMain::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(dlgMain)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(dlgMain, CDialog)
	//{{AFX_MSG_MAP(dlgMain)
	ON_WM_CLOSE()
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_WM_LBUTTONDOWN()
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
	ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
	ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// dlgMain message handlers

void dlgMain::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	
	exit(0);
	CDialog::OnClose();
}

void dlgMain::OnButton1() 
{
	// TODO: Add your control notification handler code here
	
   HideAllSubDlg();

  tdlgSubBase.ShowWindow(SW_SHOW);
  CRect tRect;
  this->GetWindowRect(&tRect);

  CRect tRectSubBase;
  tdlgSubBase.GetWindowRect(&tRectSubBase);
  tdlgSubBase.MoveWindow(tRect.left+120,tRect.top+40,
	  tRectSubBase.right-tRectSubBase.left,tRectSubBase.bottom-tRectSubBase.top); 

}

BOOL dlgMain::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

    tdlgSubBase.Create(IDD_BASE);
    tdlgSubBase1.Create(IDD_BASE1);
    tdlgSubBase2.Create(IDD_BASE2);
    tdlgSubBase3.Create(IDD_BASE3);
    tdlgSubBase4.Create(IDD_BASE4);
    tdlgSubBase5.Create(IDD_BASE5);
    

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void dlgMain::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
HideAllSubDlg();

	CDialog::OnLButtonDown(nFlags, point);
}

void dlgMain::OnButton2() 
{
  HideAllSubDlg();

  tdlgSubBase1.ShowWindow(SW_SHOW);
  CRect tRect;
  this->GetWindowRect(&tRect);
  
  CRect tRectSubBase1;
  tdlgSubBase1.GetWindowRect(&tRectSubBase1);
  tdlgSubBase1.MoveWindow(tRect.left+120,tRect.top+115,       
	  tRectSubBase1.right-tRectSubBase1.left,tRectSubBase1.bottom-tRectSubBase1.top); 

}

void dlgMain::HideAllSubDlg()
{
   tdlgSubBase1.ShowWindow(SW_HIDE);
   tdlgSubBase.ShowWindow(SW_HIDE);
   tdlgSubBase2.ShowWindow(SW_HIDE);
   tdlgSubBase3.ShowWindow(SW_HIDE);
   tdlgSubBase4.ShowWindow(SW_HIDE);
   tdlgSubBase5.ShowWindow(SW_HIDE);

}

void dlgMain::OnButton3() 
{
  HideAllSubDlg();

  tdlgSubBase2.ShowWindow(SW_SHOW);
  CRect tRect;
  this->GetWindowRect(&tRect);
  
  CRect tRectSubBase2;
  tdlgSubBase2.GetWindowRect(&tRectSubBase2);
  tdlgSubBase2.MoveWindow(tRect.left+120,tRect.top+192,       
	  tRectSubBase2.right-tRectSubBase2.left,tRectSubBase2.bottom-tRectSubBase2.top); 
	
}

void dlgMain::OnButton4() 
{
  HideAllSubDlg();

  tdlgSubBase3.ShowWindow(SW_SHOW);
  CRect tRect;
  this->GetWindowRect(&tRect);
  
  CRect tRectSubBase3;
  tdlgSubBase3.GetWindowRect(&tRectSubBase3);
  tdlgSubBase3.MoveWindow(tRect.left+120,tRect.top+272,       
	  tRectSubBase3.right-tRectSubBase3.left,tRectSubBase3.bottom-tRectSubBase3.top); 
	
}

void dlgMain::OnButton5() 
{

  HideAllSubDlg();

  tdlgSubBase4.ShowWindow(SW_SHOW);
  CRect tRect;
  this->GetWindowRect(&tRect);
  
  CRect tRectSubBase4;
  tdlgSubBase4.GetWindowRect(&tRectSubBase4);
  tdlgSubBase4.MoveWindow(tRect.left+120,tRect.top+352,       
	  tRectSubBase4.right-tRectSubBase4.left,tRectSubBase4.bottom-tRectSubBase4.top); 
	
}

void dlgMain::OnButton6() 
{
  HideAllSubDlg();

  tdlgSubBase5.ShowWindow(SW_SHOW);
  CRect tRect;
  this->GetWindowRect(&tRect);
  
  CRect tRectSubBase5;
  tdlgSubBase5.GetWindowRect(&tRectSubBase5);
  tdlgSubBase5.MoveWindow(tRect.left+120,tRect.top+423,       
	  tRectSubBase5.right-tRectSubBase5.left,tRectSubBase5.bottom-tRectSubBase5.top); 
	

//dlgExcel1 tdlg;
//tdlg.DoModal();
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -