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

📄 insertdlg.cpp

📁 VC下基于SQL的图书管理系统源代码
💻 CPP
字号:
// InsertDlg.cpp : implementation file
//

#include "stdafx.h"
#include "BookAdmi.h"
#include "InsertDlg.h"
#include "BookQueryDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// InsertDlg dialog


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


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


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

/////////////////////////////////////////////////////////////////////////////
// InsertDlg message handlers

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


	TCITEM item;   
    item.mask=TCIF_TEXT;   
    item.pszText="图书信息录入"; 
	m_insertTab.InsertItem(0,&item);
	item.pszText="作者信息录入";
	m_insertTab.InsertItem(1,&item);
	item.pszText="图书分类信息录入";
	m_insertTab.InsertItem(2,&item);
	m_insertbook.Create(IDD_INSERTBOOK_DIALOG,&m_insertTab);  
	m_insertauthor.Create(IDD_INSERTAUTHORDLG_DIALOG,&m_insertTab);
	m_insertbookcla.Create(IDD_INSERTBOOKCLADLG_DIALOG,&m_insertTab);
	m_insertbook.SetWindowPos(NULL,10,30,600,350,SWP_SHOWWINDOW);   
	m_insertauthor.SetWindowPos(NULL,10,30,600,300,SWP_HIDEWINDOW); 
	m_insertbookcla.SetWindowPos(NULL,10,30,600,300,SWP_HIDEWINDOW); 
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void InsertDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
	CRect   r;   
	m_insertTab.GetClientRect(&r);
	switch(m_insertTab.GetCurSel())   
	{   
	case 0:   
	m_insertbook.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW);   
	m_insertauthor.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW);
	m_insertbookcla.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW);   
	break;   
	case 1:   
	m_insertbook.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW);   
	m_insertauthor.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW); 
	m_insertbookcla.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW);
	break;
	case 2:   
	m_insertbook.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW);   
	m_insertauthor.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_HIDEWINDOW); 
	m_insertbookcla.SetWindowPos   (NULL,10,30,r.right-20,r.bottom-40,SWP_SHOWWINDOW);

	}
	*pResult = 0;
}

⌨️ 快捷键说明

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