当前位置:网站首页>BCG 使用之新建向导效果
BCG 使用之新建向导效果
2022-07-04 18:32:00 【春蕾夏荷_728297725】
效果如下:


直接上源码:
1、修改程序入口:

BOOL CToolBarSampleApp::InitInstance()
{
InitCommonControls();
CBCGPWinApp::InitInstance();
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
CBCGControlsPropSheet propSheet;
m_pMainWnd = &propSheet;
propSheet.DoModal();
return FALSE;
}
2、创建类BCGControlsPropSheet 用于加载各个页面:
(1)BCGControlsPropSheet.h
#pragma once
#include "Page1.h"
class CBCGControlsPropSheet : public CBCGPPropertySheet
{
DECLARE_DYNAMIC(CBCGControlsPropSheet)
public:
CBCGControlsPropSheet(CWnd* pParentWnd = NULL);
public:
CPage1 m_Page1;
HICON m_hIcon;
public:
public:
virtual BOOL OnInitDialog();
public:
virtual ~CBCGControlsPropSheet();
protected:
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
(2)BCGControlsPropSheet.cpp
#include "stdafx.h"
#include "BCGControlsPropSheet.h"
#include "Resource.h"
IMPLEMENT_DYNAMIC(CBCGControlsPropSheet, CBCGPPropertySheet)
CBCGControlsPropSheet::CBCGControlsPropSheet(CWnd* pParentWnd)
:CBCGPPropertySheet (IDS_CAPTION, pParentWnd)
{
SetLook(CBCGPPropertySheet::PropSheetLook_Tabs, globalUtils.ScaleByDPI(100));//这里修改第一个参数用来显示不同的效果
SetIconsList (IDB_ICONS32, 32, RGB(255, 0, 255), TRUE);
AddPage(&m_Page1);
EnableVisualManagerStyle(TRUE, TRUE);
EnableDragClientArea();
}
CBCGControlsPropSheet::~CBCGControlsPropSheet()
{
}
BEGIN_MESSAGE_MAP(CBCGControlsPropSheet, CBCGPPropertySheet)
ON_WM_QUERYDRAGICON()
ON_WM_SYSCOMMAND()
END_MESSAGE_MAP()
BOOL CBCGControlsPropSheet::OnInitDialog()
{
BOOL bResult = CBCGPPropertySheet::OnInitDialog();
return bResult;
}
HCURSOR CBCGControlsPropSheet::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CBCGControlsPropSheet::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
BCGPShowAboutDlg (AFX_IDS_APP_TITLE);
}
else
{
CBCGPPropertySheet::OnSysCommand(nID, lParam);
}
}
3、创建各个page页面
(1)Page1.h
#pragma once
#include "Resource.h"
class CPage1 : public CBCGPPropertyPage
{
DECLARE_DYNCREATE(CPage1)
public:
CPage1();
~CPage1();
enum { IDD = IDD_TOOLBARSAMPLE_DIALOG };
public:
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
protected:
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
CMenu m_menu;
BOOL m_bItem4Checked;
};
(2)Page1.cpp
#include "stdafx.h"
#include "Page1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CPage1, CBCGPPropertyPage)
CPage1::CPage1() : CBCGPPropertyPage(CPage1::IDD)
{
}
CPage1::~CPage1()
{
}
void CPage1::DoDataExchange(CDataExchange* pDX)
{
CBCGPPropertyPage::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CPage1, CBCGPPropertyPage)
END_MESSAGE_MAP()
BOOL CPage1::OnInitDialog()
{
CBCGPPropertyPage::OnInitDialog();
return TRUE;
}
边栏推荐
- 牛客小白月赛7 I 新建 Microsoft Office Word 文档
- HDU 6440 2018中国大学生程序设计网络选拔赛
- Shell 編程核心技術《四》
- 【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
- 1007 Maximum Subsequence Sum(25 分)(PAT甲级)
- 1009 Product of Polynomials(25 分)(PAT甲级)
- Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
- C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
- An example of multi module collaboration based on NCF
- 牛客小白月赛7 E Applese的超能力
猜你喜欢

Stream流

PointNeXt:通过改进的模型训练和缩放策略审视PointNet++

Lm10 cosine wave homeopathic grid strategy

Oracle with as ora-00903: invalid table name multi report error

BI技巧丨权限轴

Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?

Master the use of auto analyze in data warehouse

SSRS筛选器的IN运算(即包含于)用法

Stream stream

To sort out messy header files, I use include what you use
随机推荐
如何使用Async-Awati异步任务处理代替BackgroundWorker?
勾股数规律(任意三个数能够满足勾股定理需要满足的条件)
HMM隐马尔可夫模型最详细讲解与代码实现
26. Delete the duplicate item C solution in the ordered array
更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
In flinksql, in addition to data statistics, is the saved data itself a state
prometheus安装
反射(一)
《工作、消费主义和新穷人》的微信读书笔记
mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
How test engineers "attack the city" (Part I)
Oracle with as ora-00903: invalid table name multi report error
Introduction to polyfit software
问下各位大佬有用过cdc直接mysql to clickhouse的么
LeetCode第300场周赛(20220703)
Lm10 cosine wave homeopathic grid strategy
求2的n次方
HDU 1097 A hard puzzle
Shell 編程核心技術《四》
牛客小白月赛7 谁是神箭手