当前位置:网站首页>Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
Cbcgptabwnd control used by BCG (equivalent to MFC TabControl)
2022-07-04 19:42:00 【Spring buds and summer lotus_ seven hundred and twenty-eight mi】
1、 Create a new sub dialog box and modify the properties , Create a new class at the same time NyPage1


2、 In the dialog box of new project default class , Add one pic Control and modify hidden properties

3、 Modify the contents of the default class :
(1) Header file
Add destructor :
~CBCGTabWndSampleDlg()
{
if (_NyPage1 != nullptr)
{
delete _NyPage1;
_NyPage1 = nullptr;
}
if (_NyPage2 != nullptr)
{
delete _NyPage2;
_NyPage2 = nullptr;
}
}
Define members :
CBCGPTabWnd m_wndTab;
NyPage1 *_NyPage1;
NyPage1 *_NyPage2;
afx_msg LRESULT OnMoveTab(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnChangeActiveTab(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnRenameTab(WPARAM wp, LPARAM lp);
afx_msg LRESULT OnChangeTabSelection(WPARAM wp, LPARAM lp);
(2) In the implementation file
Message response
N_REGISTERED_MESSAGE(BCGM_ON_MOVE_TAB, CBCGTabWndSampleDlg::OnMoveTab)
// Switch tab Responding to events
ON_REGISTERED_MESSAGE(BCGM_CHANGE_ACTIVE_TAB, CBCGTabWndSampleDlg::OnChangeActiveTab)
ON_REGISTERED_MESSAGE(BCGM_ON_RENAME_TAB, CBCGTabWndSampleDlg::OnRenameTab)
ON_REGISTERED_MESSAGE(BCGM_CHANGE_TAB_SELECTION, CBCGTabWndSampleDlg::OnChangeTabSelection)
BOOL CBCGTabWndSampleDlg::OnInitDialog()
{
CBCGPDialog::OnInitDialog();
CRect rectTab;
GetDlgItem(IDC_TAB)->GetWindowRect(&rectTab);
ScreenToClient(&rectTab);
m_wndTab.Create(CBCGPTabWnd::STYLE_3D, rectTab, this, 1, CBCGPTabWnd::LOCATION_TOP);
{
_NyPage1 = new NyPage1();
_NyPage1->Create(NyPage1::IDD, &m_wndTab);
m_wndTab.AddTab(_NyPage1, _T(" first page "), 0);
_NyPage2 = new NyPage1();
_NyPage2->Create(NyPage1::IDD, &m_wndTab);
m_wndTab.AddTab(_NyPage2, _T(" The second page "), 1);
}
m_wndTab.SetActiveTab(0);
m_wndTab.RecalcLayout();
m_wndTab.RedrawWindow();
return TRUE; // return TRUE unless you set the focus to a control
}
LRESULT CBCGTabWndSampleDlg::OnMoveTab(WPARAM wp, LPARAM lp)
{
return 1;
}
LRESULT CBCGTabWndSampleDlg::OnChangeActiveTab(WPARAM wp, LPARAM lp)
{
return 1;
}
LRESULT CBCGTabWndSampleDlg::OnRenameTab(WPARAM wp, LPARAM lp)
{
return 1;
}
LRESULT CBCGTabWndSampleDlg::OnChangeTabSelection(WPARAM wp, LPARAM lp)
{
return 1;
}
thus , You can see its simple effect , No beautification :

边栏推荐
- Utilisation de la barre de progression cbcggprogressdlgctrl utilisée par BCG
- Jetpack compose tutorial
- Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
- The difference and usage between substr (), slice (), and substring () in the string interception methods of "understand series after reading"
- Multi table operation inner join query
- Reflection (I)
- Generate XML elements
- HDU 6440 2018 Chinese college student program design network competition
- 安徽 中安在线文旅频道推出“跟着小编游安徽”系列融媒体产品
- 更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
猜你喜欢

Master the use of auto analyze in data warehouse

线上数据库迁移的几种方法

Hough transform Hough transform principle

c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)

Lm10 cosine wave homeopathic grid strategy

Introduction to polyfit software

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

Pointnet/Pointnet++点云数据集处理并训练

【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案

记一次 .NET 某工控数据采集平台 线程数 爆高分析
随机推荐
BCG 使用之CBCGPProgressDlg进度条使用
西门子HMI下载时提示缺少面板映像解决方案
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
指定输出的字符集
C # use stopwatch to measure the running time of the program
Personal thoughts on Architecture Design (this article will be revised and updated continuously later)
明明的随机数
kotlin 继承
Shell programming core technology "three"
1008 Elevator(20 分)(PAT甲级)
在线SQL转Excel(xls/xlsx)工具
Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
多表操作-外连接查询
Hough Transform 霍夫变换原理
Pytorch学习(四)
c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)
YOLOv5s-ShuffleNetV2
Online sql to excel (xls/xlsx) tool
@transactional滥用导致数据源连接池耗尽问题
kotlin 条件控制