当前位置:网站首页>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;
}
边栏推荐
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- 用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- SSRS筛选器的IN运算(即包含于)用法
- FTP, SFTP file transfer
- Mysql database basic operation -ddl | dark horse programmer
- 1007 Maximum Subsequence Sum(25 分)(PAT甲级)
- 牛客小白月赛7 E Applese的超能力
- An example of multi module collaboration based on NCF
- mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
猜你喜欢

Stream stream

Opencv functions and methods related to binary threshold processing are summarized for comparison and use

西门子HMI下载时提示缺少面板映像解决方案

读写关闭的channel是啥后果?

Hough Transform 霍夫变换原理

How to use async Awati asynchronous task processing instead of backgroundworker?

欧拉函数

Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples

Lm10 cosine wave homeopathic grid strategy

The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
随机推荐
Functional interface
LM10丨余弦波动顺势网格策略
关于判断点是否位于轮廓内的一点思考
876. 链表的中间结点
prometheus安装
ftp、sftp文件传输
数组中的第K个最大元素
整理混乱的头文件,我用include what you use
Educational Codeforces Round 22 E. Army Creation
node_exporter部署
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
双冒号作用运算符以及命名空间详解
Shell 编程核心技术《一》
大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
Mysql database basic operation -ddl | dark horse programmer
Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
指定输出的字符集
HDU 1372 & POJ 2243 Knight Moves(广度优先搜索)
有关架构设计的个人思考(本文后续不断修改更新)
node_ Exporter deployment