📄 mypropertypage1.cpp
字号:
// MyPropertyPage1.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "MyPropertyPage1.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CMyPropertyPage1, CPropertyPage)
IMPLEMENT_DYNCREATE(CMyPropertyPage2, CPropertyPage)
IMPLEMENT_DYNCREATE(CMyPropertyPage3, CPropertyPage)
/////////////////////////////////////////////////////////////////////////////
// CMyPropertyPage1 property page
CMyPropertyPage1::CMyPropertyPage1() : CPropertyPage(CMyPropertyPage1::IDD)
{
//{{AFX_DATA_INIT(CMyPropertyPage1)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CMyPropertyPage1::~CMyPropertyPage1()
{
}
void CMyPropertyPage1::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyPropertyPage1)
DDX_Control(pDX, IDC_SCROLLBAR_VERTICAL, m_VScrollbar);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyPropertyPage1, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage1)
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyPropertyPage2 property page
CMyPropertyPage2::CMyPropertyPage2() : CPropertyPage(CMyPropertyPage2::IDD)
{
//{{AFX_DATA_INIT(CMyPropertyPage2)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CMyPropertyPage2::~CMyPropertyPage2()
{
}
void CMyPropertyPage2::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyPropertyPage2)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyPropertyPage2, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage2)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyPropertyPage3 property page
CMyPropertyPage3::CMyPropertyPage3() : CPropertyPage(CMyPropertyPage3::IDD)
{
//{{AFX_DATA_INIT(CMyPropertyPage3)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CMyPropertyPage3::~CMyPropertyPage3()
{
}
void CMyPropertyPage3::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyPropertyPage3)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyPropertyPage3, CPropertyPage)
//{{AFX_MSG_MAP(CMyPropertyPage3)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CMyPropertyPage1::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
//m_pPropertySheet1->SetPropertyButtons(PSWIZB_NEXT);
//滚动条初始化
m_VScrollbar.SetScrollRange(1,10);//设置滚动条的最小,最大值
m_VScrollbar.SetScrollPos(1);//设置滚动条的当前值为1
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMyPropertyPage1::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
UINT nCurrentPos;//存放滚动条的当前位置
switch(nSBCode)
{
case SB_LINEUP: //向上滚动
nCurrentPos=(pScrollBar->GetScrollPos())-1;
pScrollBar->SetScrollPos(nCurrentPos);
break;
case SB_LINEDOWN: //向下滚动
nCurrentPos=(pScrollBar->GetScrollPos())+1;
pScrollBar->SetScrollPos(nCurrentPos);
break;
case SB_THUMBPOSITION: //拖动滚动条至当前位置
nCurrentPos=nPos;
pScrollBar->SetScrollPos(nCurrentPos);
break;
default:
break;
}
CPropertyPage::OnVScroll(nSBCode, nPos, pScrollBar);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -