📄 spin1.cpp
字号:
// Spin1.cpp : implementation file
//
#include "stdafx.h"
#include "yonghujiemian.h"
#include "Spin1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Spin1 dialog
Spin1::Spin1(CWnd* pParent /*=NULL*/)
: CDialog(Spin1::IDD, pParent)
{
//{{AFX_DATA_INIT(Spin1)
m_Edit1 = 0;
m_Edit2 = _T("");
//}}AFX_DATA_INIT
}
void Spin1::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Spin1)
DDX_Control(pDX, IDC_SPIN2, m_Spin2);
DDX_Control(pDX, IDC_SPIN1, m_Spin);
DDX_Text(pDX, IDC_EDIT1, m_Edit1);
DDX_Text(pDX, IDC_EDIT2, m_Edit2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Spin1, CDialog)
//{{AFX_MSG_MAP(Spin1)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Spin1 message handlers
BOOL Spin1::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_Spin.SetBuddy(GetDlgItem(IDC_EDIT1)); //设置编辑控件为Spin控件的伙伴窗口
m_Spin.SetRange( 30, 300 ); //设置数据范围
m_Spin2.SetBuddy(GetDlgItem(IDC_EDIT2)); //设置编辑控件为Spin控件的伙伴窗口
m_Spin2.SetRange( 30, 300 ); //设置数据范围
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void Spin1::OnChangeEdit1()
{
m_Edit1= m_Spin.GetPos(); //获取Spin控件当前值
m_Edit2= m_Spin2.GetPos(); //获取Spin控件当前值
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -