当前位置:网站首页>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 :

边栏推荐
- BCG 使用之新建向导效果
- Some thoughts on whether the judgment point is located in the contour
- FPGA时序约束分享01_四大步骤简述
- Qt实现界面滑动切换效果
- PointNeXt:通过改进的模型训练和缩放策略审视PointNet++
- 双冒号作用运算符以及命名空间详解
- 1009 product of polynomials (25 points) (PAT class a)
- Shell programming core technology "four"
- 黑马程序员-软件测试--07阶段2-linux和数据库-09-24-linux命令学习步骤,通配符,绝对路径,相对路径,文件和目录常用命令,文件内容相关操作,查看日志文件,ping命令使用,
- Euler function
猜你喜欢

Stream stream

Swagger suddenly went crazy

Several methods of online database migration
牛客小白月赛7 谁是神箭手

水晶光电:长安深蓝SL03的AR-HUD产品由公司供应

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

HMM隐马尔可夫模型最详细讲解与代码实现

Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading

欧拉函数

BCG 使用之新建向导效果
随机推荐
如何使用Async-Awati异步任務處理代替BackgroundWorker?
黑马程序员-软件测试--09阶段2-linux和数据库-31-43修改文件权限字母发的说明,-查找链接修改文件,查找文件命令,链接文件,压缩解压方式,vi编辑器基本使用,
更强的 JsonPath 兼容性及性能测试之2022版(Snack3,Fastjson2,jayway.jsonpath)
Niuke Xiaobai month race 7 F question
Swagger suddenly went crazy
Multi table operation - external connection query
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
Shell 编程核心技术《三》
kotlin 循环控制
Explicit random number
牛客小白月赛7 谁是神箭手
Niuke Xiaobai monthly race 7 I new Microsoft Office Word document
An example of multi module collaboration based on NCF
1006 Sign In and Sign Out(25 分)(PAT甲级)
Chrome开发工具:VMxxx文件是什么鬼
1009 product of polynomials (25 points) (PAT class a)
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
BCG 使用之新建向导效果
Wechat reading notes of "work, consumerism and the new poor"
在线SQL转Excel(xls/xlsx)工具