📄 mainpage.cpp
字号:
// MainPage.cpp : implementation file
//
#include "stdafx.h"
#include "Jwc.h"
#include "MainPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainPage dialog
CMainPage::CMainPage(CWnd* pParent /*=NULL*/)
: CDialog(CMainPage::IDD, pParent)
{
//{{AFX_DATA_INIT(CMainPage)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMainPage::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMainPage)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMainPage, CDialog)
//{{AFX_MSG_MAP(CMainPage)
ON_BN_CLICKED(IDC_BUTTON1, Message_Student)
ON_BN_CLICKED(IDC_BUTTON4, Message_Class)
ON_BN_CLICKED(IDC_BUTTON3, Message_Teacher)
ON_BN_CLICKED(IDC_BUTTON5, OnTuichu)
ON_BN_CLICKED(IDC_BUTTON6, OnReturn)
ON_WM_PAINT()
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMainPage message handlers
void CMainPage::Message_Student()
{
// TODO: Add your control notification handler code here
CStudent dlg;
dlg.m_pConnection=m_pConnection;
dlg.DoModal();
}
void CMainPage::Message_Class()
{
// TODO: Add your control notification handler code here
CClass dlg;
dlg.DoModal();
}
void CMainPage::Message_Teacher()
{
// TODO: Add your control notification handler code here
CTeacher dlg;
dlg.DoModal();
}
void CMainPage::OnTuichu()
{
// TODO: Add your control notification handler code here
OnOK();
}
void CMainPage::OnReturn()
{
// TODO: Add your control notification handler code here
CJwcDlg dlg;
this->OnOK();
dlg.DoModal();
}
void CMainPage::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect r;
GetWindowRect(&r);
CPoint p1(r.left, r.top), p2(r.right, r.bottom);
ScreenToClient(&p1);
ScreenToClient(&p2);
CClientDC pDC(this);
CBitmap bit;
//bit = new CBitmap;
//bit->LoadBitmap(IDB_BITMAP1);
bit.LoadBitmap(IDB_BITMAP2);
CDC memDC;
memDC.CreateCompatibleDC(&pDC);
memDC.SelectObject(&bit);
pDC.StretchBlt(0,0,p2.x-p1.x,p2.y-p1.y, &memDC, 0,0,486,365, SRCCOPY);
// Do not call CDialog::OnPaint() for painting messages
}
HBRUSH CMainPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
return hbr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -