当前位置:网站首页>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 :
边栏推荐
- Opencv functions and methods related to binary threshold processing are summarized for comparison and use
- 反射(一)
- 1006 Sign In and Sign Out(25 分)(PAT甲级)
- 如何使用Async-Awati异步任务处理代替BackgroundWorker?
- Niuke Xiaobai month race 7 e applese's super ability
- 西门子HMI下载时提示缺少面板映像解决方案
- PointNeXt:通过改进的模型训练和缩放策略审视PointNet++
- Pytest 可视化测试报告之 Allure
- BCG 使用之CBCGPTabWnd控件(相当于MFC TabControl)
- 矩阵翻转(数组模拟)
猜你喜欢
Opencv functions and methods related to binary threshold processing are summarized for comparison and use
Detailed explanation of the binary processing function threshold() of opencv
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
Hough Transform 霍夫变换原理
To sort out messy header files, I use include what you use
YOLOv5s-ShuffleNetV2
Introduction to polyfit software
Multi table operation inner join query
Niuke Xiaobai month race 7 who is the divine Archer
Pointnet/Pointnet++点云数据集处理并训练
随机推荐
Educational Codeforces Round 22 E. Army Creation
数据集划分
求2的n次方
HDU 1372 & POJ 2243 Knight moves (breadth first search)
Detailed explanation of the binary processing function threshold() of opencv
1006 sign in and sign out (25 points) (PAT class a)
Mysql database basic operation -ddl | dark horse programmer
Utilisation de la barre de progression cbcggprogressdlgctrl utilisée par BCG
FPGA timing constraint sharing 01_ Brief description of the four steps
92.(cesium篇)cesium楼栋分层
How to use async Awati asynchronous task processing instead of backgroundworker?
【毕业季】绿蚁新醅酒,红泥小火炉。晚来天欲雪,能饮一杯无?
C语言-入门-基础-语法-流程控制(七)
1003 Emergency(25 分)(PAT甲级)
[QNX Hypervisor 2.2用户手册]6.3.1 工厂页和控制页
How test engineers "attack the city" (Part I)
Pointnet/Pointnet++点云数据集处理并训练
BCG 使用之CBCGPTabWnd控件(相当于MFC TabControl)
Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
Shell programming core technology "four"