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

📄 dlg2.cpp

📁 VC++ 界面的三窗口分割程序源代码适合初学者使用
💻 CPP
字号:
// DLG2.cpp : implementation file
//

#include "stdafx.h"
#include "mat.h"
#include "DLG2.h"
#include "DPAGE1.h"
#include "DPAGE2.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDLG2 dialog


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


void CDLG2::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDLG2)
	DDX_Control(pDX, IDC_TAB1, m_TAB);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDLG2, CDialog)
	//{{AFX_MSG_MAP(CDLG2)
	ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDLG2 message handlers

BOOL CDLG2::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
//GetParentFrame()->RecalcLayout(); 

//ResizeParentToFit(); 


	//确定选项页位置
	CRect rs; 

m_TAB.GetClientRect(rs); 

rs.top+=30; 

rs.bottom-=10; 

rs.left+=10; 

rs.right-=10; 
//添加两个选项页
TCITEM tm;
tm.mask=TCIF_TEXT;
tm.pszText="震源类型设置";
m_TAB.InsertItem(0,&tm);
tm.pszText="可控震源设置";
m_TAB.InsertItem(1,&tm);
m_page1dlg.Create(IDD_PAGE1,this);
m_page2dlg.Create(IDD_PAGE2,this);
m_page1dlg.MoveWindow(rs); 

m_page2dlg.MoveWindow(rs);
m_page1dlg.ShowWindow(SW_SHOW); // edit box在属性页的第一页
m_page2dlg.ShowWindow(SW_SHOW); // static box在属性页的第二页
m_TAB.SetCurSel(0); 

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







void CDLG2::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	int CurSel; 

CurSel=m_TAB.GetCurSel(); 

switch(CurSel) 

{ 

case 0: 

m_page1dlg.ShowWindow(TRUE); 

m_page2dlg.ShowWindow(FALSE); 

break; 

case 1: 

m_page1dlg.ShowWindow(FALSE); 

m_page2dlg.ShowWindow(TRUE); 

break; 

//case 2: 

//page1.ShowWindow(FALSE); 

//page2.ShowWindow(TRUE); 

//break; 

default: ;
}


	*pResult = 0;
}

⌨️ 快捷键说明

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