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

📄 controlsprop.cpp

📁 这些源代码
💻 CPP
字号:
// ControlsProp.cpp : implementation file
//

#include "stdafx.h"
#include "Controls.h"
#include "ControlsProp.h"

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

/////////////////////////////////////////////////////////////////////////////
// CControlsProp

IMPLEMENT_DYNAMIC(CControlsProp, CPropertySheet)

CControlsProp::CControlsProp(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
	AddPage (&m_StaticPage);
	AddPage (&m_EditPage);
	AddPage (&m_RichEditPage);
	AddPage (&m_ButtonPage);
	AddPage (&m_ListBoxPage);
	AddPage (&m_ComboBoxPage);
	AddPage (&m_ScrollBarPage);
	AddPage (&m_ImageListPage);
	AddPage (&m_ProgressBarPage);
	AddPage (&m_SliderPage);
	AddPage (&m_HeaderPage);
	m_psh.dwFlags |= PSH_NOAPPLYNOW;
	m_psh.dwFlags &= ~PSH_HASHELP;
}

CControlsProp::CControlsProp(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
	AddPage (&m_StaticPage);
	AddPage (&m_EditPage);
	AddPage (&m_RichEditPage);
	AddPage (&m_ButtonPage);
	AddPage (&m_ListBoxPage);
	AddPage (&m_ComboBoxPage);
	AddPage (&m_ScrollBarPage);
	AddPage (&m_ImageListPage);
	AddPage (&m_ProgressBarPage);
	AddPage (&m_SliderPage);
	AddPage (&m_SpinnerPage);
	AddPage (&m_HeaderPage);
	m_psh.dwFlags |= PSH_NOAPPLYNOW;
	m_psh.dwFlags &= ~PSH_HASHELP;
}

CControlsProp::~CControlsProp()
{
}


BEGIN_MESSAGE_MAP(CControlsProp, CPropertySheet)
	//{{AFX_MSG_MAP(CControlsProp)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CControlsProp message handlers

BOOL CControlsProp::OnInitDialog() 
{
	BOOL bResult = CPropertySheet::OnInitDialog();

	CWnd *button = GetDlgItem (IDOK);
	button->ShowWindow (SW_HIDE);
	button = GetDlgItem (IDHELP);
	button->ShowWindow (SW_HIDE);
	button = GetDlgItem (IDCANCEL);
	button->SetWindowText (_T("Close"));
	return bResult;
}

void CControlsProp::OnPaint() 
{
	bool GetCommonControlsVersion(DWORD &dwMajor, DWORD &dwMinor);

	CPaintDC dc(this); // device context for painting

	CWnd *button = GetDlgItem (IDCANCEL);
	CRect rc;
	button->GetWindowRect (&rc);
	ScreenToClient (&rc);
	rc.left = 20;
	DWORD dwMajor, dwMinor;

	GetCommonControlsVersion(dwMajor, dwMinor);
	CString strText;
	strText.Format ("Windows Common Controls Library Version %d.%02d",
					dwMajor, dwMinor);
	dc.SetBkMode (TRANSPARENT);
	dc.DrawText (strText, rc, DT_VCENTER);
}

⌨️ 快捷键说明

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