当前位置:网站首页>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 :
边栏推荐
- YOLOv5s-ShuffleNetV2
- English grammar_ Noun - use
- Some thoughts on whether the judgment point is located in the contour
- 1011 World Cup betting (20 points) (pat a)
- FPGA时序约束分享01_四大步骤简述
- 1006 Sign In and Sign Out(25 分)(PAT甲级)
- Technologie de base de la programmation Shell IV
- @Data source connection pool exhaustion caused by transactional abuse
- 偏移量函数及开窗函数
- TCP两次挥手,你见过吗?那四次握手呢?
猜你喜欢
Niuke Xiaobai month race 7 who is the divine Archer
The explain statement in MySQL queries whether SQL is indexed, and several types in extra collate and summarize
TCP waves twice, have you seen it? What about four handshakes?
Oracle with as ORA-00903: invalid table name 多表报错
勾股数规律(任意三个数能够满足勾股定理需要满足的条件)
记一次 .NET 某工控数据采集平台 线程数 爆高分析
如何使用Async-Awati异步任务处理代替BackgroundWorker?
水晶光电:长安深蓝SL03的AR-HUD产品由公司供应
牛客小白月赛7 谁是神箭手
Some thoughts on whether the judgment point is located in the contour
随机推荐
1007 Maximum Subsequence Sum(25 分)(PAT甲级)
Educational Codeforces Round 22 E. Army Creation
92.(cesium篇)cesium楼栋分层
The page element is vertically and horizontally centered, realizing the vertical and horizontal centering of known or unknown width.
Mysql database basic operation -ddl | dark horse programmer
线上数据库迁移的几种方法
TCP两次挥手,你见过吗?那四次握手呢?
黑马程序员-软件测试--07阶段2-linux和数据库-09-24-linux命令学习步骤,通配符,绝对路径,相对路径,文件和目录常用命令,文件内容相关操作,查看日志文件,ping命令使用,
JVM系列之对象的创建
HDU 1097 A hard puzzle
记一次 .NET 某工控数据采集平台 线程数 爆高分析
Stream stream
多表操作-内连接查询
Add namespace declaration
Online text line fixed length fill tool
Wechat reading notes of "work, consumerism and the new poor"
安徽 中安在线文旅频道推出“跟着小编游安徽”系列融媒体产品
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
Cbcgpprogressdlgctrl progress bar used by BCG
Oracle with as ora-00903: invalid table name multi report error